is_contiguous¶
- metatensor.is_contiguous(tensor: TensorMap) bool [source]¶
Checks whether all values arrays and gradients values arrays (if present) in all
TensorBlock
of an inputTensorMap
are contiguous.Note that arrays of
Labels
objects are not checked for contiguity.
- metatensor.is_contiguous_block(block: TensorBlock) bool [source]¶
Checks whether the values array and gradients values arrays (if present) of an input
TensorBlock
are contiguous.Note that arrays of
Labels
objects are not checked for contiguity.- Parameters:
block (TensorBlock) – the input
TensorBlock
.- Returns:
bool, true if all values arrays contiguous, false otherwise.
- Return type: