评价此页

torch.Tensor.is_contiguous#

Tensor.is_contiguous(memory_format=torch.contiguous_format) bool#

如果 self 张量在内存中的顺序与 memory_format 指定的顺序一致,则返回 True。

参数

memory_format (torch.memory_format, optional) – 指定内存分配顺序。默认为 torch.contiguous_format