mlx.data.Buffer.filter_key

mlx.data.Buffer.filter_key#

Buffer.filter_key(self: mlx.data._c.Buffer, key: str, remove: bool = False) mlx.data._c.Buffer#

Transform the samples to either only contain this key or never contain this key based on the value of remove.

Parameters:
  • key (str) – The key to keep or remove.

  • remove (bool) – If set to True then remove this key instead of keeping it (default: False).