mlx.data.Buffer.filter_by_shape

mlx.data.Buffer.filter_by_shape#

Buffer.filter_by_shape(self: mlx.data._c.Buffer, key: str, dim: int, low: int = - 1, high: int = - 1) mlx.data._c.Buffer#

Filter samples based on the shape of the array.

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

  • dim (int) – The shape dimension based on which we are filtering.

  • low (int) – Minimum acceptable size for the dimension (inclusive).

  • high (int) – Maximum acceptable size for the dimension (inclusive). If negative size is given then it is assumed we have no upper limit.