torch.Tensor.is_contiguous¶
- Tensor.is_contiguous(memory_format=torch.contiguous_format) bool¶
如果
self张量在内存中按内存格式指定的顺序连续,则返回 True。- 参数
memory_format (
torch.memory_format, 可选) – 指定内存分配顺序。默认值:torch.contiguous_format。
如果 self 张量在内存中按内存格式指定的顺序连续,则返回 True。
memory_format (torch.memory_format, 可选) – 指定内存分配顺序。默认值:torch.contiguous_format。