PyTorch - contiguous()

前端 未结 6 2261
春和景丽
春和景丽 2020-12-22 15:40

I was going through this example of a LSTM language model on github (link). What it does in general is pretty clear to me. But I\'m still struggling to understand what calli

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-22 16:33

    As in the previous answer contigous() allocates contigous memory chunks, it'll be helpful when we're passing tensor to c or c++ backend code where tensors are passed as pointers

提交回复
热议问题