Pytorch常用函数宝典(长期更新)

2020-09-02  本文已影响0人  加油11dd23

一、contiguous()

Pytorch官方文档

contiguous(memory_format=torch.contiguous_format) → Tensor

Returns a contiguous in memory tensor containing the same data as self tensor. If self tensor is already in the specified memory format, this function returns the self tensor.

Parameters

memory_format (torch.memory_format, optional) – the desired memory format of returned Tensor. Default: torch.contiguous_format.

二、view()

三、squeeze()

四、permute()

上一篇下一篇

猜你喜欢

热点阅读