Jump to content

PyTorch: Difference between revisions

329 bytes added ,  5 March 2020
Line 39: Line 39:


==Usage==
==Usage==
===torch.nn.functional===
[https://pytorch.org/docs/stable/nn.functional.html PyTorch Documentation]
====F.grid_sample====
[https://pytorch.org/docs/stable/nn.functional.html#grid-sample Doc]<br>
This function allows you to perform interpolation on your input tensor.<br>
It is very useful for resizing images or warping images.


==Memory Usage==
==Memory Usage==
Reducing memory usage
Reducing memory usage
* Save loss using [https://pytorch.org/docs/stable/tensors.html#torch.Tensor.item <code>.item()</code>] which returns a standard Python number
* Save loss using [https://pytorch.org/docs/stable/tensors.html#torch.Tensor.item <code>.item()</code>] which returns a standard Python number