make_contiguous¶
These operations are equivalent of numpy.ascontiguousarray() in numpy
and torch.Tensor.contiguous() in torch.
- metatensor.make_contiguous(tensor: TensorMap) TensorMap[source]¶
Returns a new
TensorMapwhere all values and gradient values arrays are made to be contiguous.
- metatensor.make_contiguous_block(block: TensorBlock) TensorBlock[source]¶
Returns a new
TensorBlockwhere the values and gradient (if present) arrays are made to be contiguous.- Parameters:
block (TensorBlock) – the input
TensorBlock.- Return type: