Skip to content

Commit

Permalink
Update pytorch.md
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipMay authored Sep 19, 2024
1 parent 58e7b94 commit b570080
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/machine-learning/pytorch.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

## Commands

- [torch.Tensor.item()](https://pytorch.org/docs/stable/generated/torch.Tensor.item.html): convert tensor to standard Python number - only works for tensors with one element
- [torch.Tensor.item()](https://pytorch.org/docs/stable/generated/torch.Tensor.item.html)
- convert tensor to standard Python number
- only works for tensors with one element
- implicitly moves the value to the CPU

0 comments on commit b570080

Please sign in to comment.