mindspore.Tensor.is_contiguous
- Tensor.is_contiguous()[source]
Determines whether the memory of tensor is contiguous.
- Returns
Bool, True if tensor memory is contiguous, False otherwise.
Examples
>>> import mindspore as ms >>> import numpy as np >>> from mindspore import Tensor, ops >>> x = Tensor([[1, 2, 3], [4, 5, 6]], dtype=ms.float32) >>> y = ops.transpose(x, (1, 0)) >>> print(y.is_contiguous()) False