Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 1.29 KB

pytorch.md

File metadata and controls

21 lines (18 loc) · 1.29 KB

PyTorch and PyTorch Lightning

General advice:

Learning PyTorch Lightning

Optimizing for Performance

A checklist of your code

  • You should always detach() for any code that is not part of the computational graph
  • If you are using the network without training it, make sure to call net.eval() and ensure it has a no_grad in one way or another (i.e. a with torch.no_grad:)
  • You should basically never call item() inside of core differentiated algorithms. Maybe in detached stuff.