Commit 55cbaa1
Summary:
Pull Request resolved: #1580
`to` only allocates new tensors if they don't satisfy the `dtype` and `device` classes, so there is no a downside to calling `to` outside of the `if` statements. See the [docs here](https://pytorch.org/docs/stable/generated/torch.Tensor.to.html).
Reviewed By: Balandat
Differential Revision: D42163726
fbshipit-source-id: c69fb78e5d04fcb369bbd5c9c1a6d33f01bb525e
1 parent 8f58784 commit 55cbaa1
1 file changed
+1
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 203 | + | |
0 commit comments