drop_blocks#
- metatensor.drop_blocks(tensor: TensorMap, keys: Labels, copy: bool = False) TensorMap[source]#
- Drop specified key/block pairs from a TensorMap. - Parameters:
- tensor (TensorMap) – the TensorMap to drop the key-block pair from. 
- keys (Labels) – a - Labelsobject containing the keys of the blocks to drop
- copy (bool) – if - True, the returned- TensorMapis constructed by copying the blocks from the input tensor. If- False(default), the values of the blocks in the output- TensorMapreference the same data as the input tensor. The latter can be useful for limiting memory usage, but should be used with caution when manipulating the underlying data.
 
- Returns:
- the input - TensorMapwith the specified key/block pairs dropped.
- Return type: