torch Tensor.contiguous()

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2025 Oct 29 11:30
Editor
Edited
Edited
2025 Oct 29 11:33
Refs
Refs
a = torch.Tensor([[1,2,3],[5,6,7]]) a.is_contiguous() # True a.transpose(0,1).is_contiguous() # False a.transpose(0,1).contiguous().is_contiguous() # True
 
 
 
 
 
 
 

Recommendations