Jump to content

PyTorch: Difference between revisions

5 bytes removed ,  27 January 2021
Line 81: Line 81:
When possible, use functions which return new views of existing tensors rather than making duplicates of tensors:
When possible, use functions which return new views of existing tensors rather than making duplicates of tensors:
* [https://pytorch.org/docs/stable/tensors.html#torch.Tensor.permute <code>permute</code>]
* [https://pytorch.org/docs/stable/tensors.html#torch.Tensor.permute <code>permute</code>]
* [https://pytorch.org/docs/stable/tensors.html#torch.Tensor.expand <code>expand</code> (as opposed to <code>repeat</code>)]
* [https://pytorch.org/docs/stable/tensors.html#torch.Tensor.expand <code>expand</code>] instead of <code>repeat</code>
* [https://pytorch.org/docs/stable/tensors.html#torch.Tensor.view <code>view</code>]
* [https://pytorch.org/docs/stable/tensors.html#torch.Tensor.view <code>view</code>]