mlx.data.Buffer.remove_value

mlx.data.Buffer.remove_value#

Buffer.remove_value(self: mlx.data._c.Buffer, key: str, size_key: str, dim: int, value: float, pad: float = 0) mlx.data._c.Buffer#

Remove instances of a certain value from an array and shift the whole array to the left.

The size of the array remains unchanged and the end is replaced with pad values. Moreover, the length array is updated to match the number of values present.

Parameters:
  • key (str) – The sample key that contains the array we are operating on.

  • size_key (str) – The sample key that contains the array with the valid sizes of the array at key.

  • dim (int) – The dimension the sizes correspond to and the one to be filtered.

  • value (double) – The value to look for and remove.

  • pad (double) – The pad value to use.