Where is the source code for `torch.Tensor.contiguous()`?
data = data.view(bsz, -1).t().contiguous()
dl4daniel
apaszke
Thanks a lot!
dl4daniel
<SCODE>x = torch.randn(5, 4)
print(x.stride(), x.is_contiguous())
print(x.t().strinde(), x.t().is_contiguous())
x.view(4, 5) # ok
x.t().view(4, 5) # fails
<ECODE>
apaszke
dl4daniel
kj7kunal
Thanks for the clarification. I guess there is a minor typo in the second print: print(x.t().strinde(), x.t().is_contiguous()) should be print(x.t().stride(), x.t().is_contiguous())
yassineAlouini