0

In PyTorch, people usually call tensor.permute(2,0,1,3).contiguous(). If I call this function in tensorflow 2.0, is it enough to just call tf.reshape(tensor, perm = [2, 0, 1, 3])?

or what is a contiguous function in tensorflow 2.0?

M.Innat
  • 13,008
  • 6
  • 38
  • 74
alryosha
  • 485
  • 1
  • 6
  • 13
  • You stated a potential solution (`tf.reshape..`). So, haven't you tried it already? If so, what's the issue (error or reliability)? – M.Innat Jan 17 '22 at 07:41
  • There is no issue, but I don't know whether the memory of tensor become contiguous or not. Therefore, I want to explicitly make tensor contiguous, but I can't find contiguous function in Tensorflow. – alryosha Jan 19 '22 at 11:28
  • 1
    Can you go through this question and conversation? https://stackoverflow.com/q/53398721/9215780 – M.Innat Jan 19 '22 at 14:07

0 Answers0