Test `to`, `cpu` and `cuda`. For `to`, check args and kwargs.
(self, device, dtype)
| 143 | @parameterized.expand(TESTS) |
| 144 | @skip_if_no_cuda |
| 145 | def test_to_cuda(self, device, dtype): |
| 146 | """Test `to`, `cpu` and `cuda`. For `to`, check args and kwargs.""" |
| 147 | orig, _ = self.get_im(device=device, dtype=dtype) |
| 148 | m = orig.clone() |
| 149 | m = m.to("cuda") |
| 150 | self.check(m, orig, ids=False, device="cuda") |
| 151 | m = m.cpu() |
| 152 | self.check(m, orig, ids=False, device="cpu") |
| 153 | m = m.cuda() |
| 154 | self.check(m, orig, ids=False, device="cuda") |
| 155 | m = m.to("cpu") |
| 156 | self.check(m, orig, ids=False, device="cpu") |
| 157 | m = m.to(device="cuda") |
| 158 | self.check(m, orig, ids=False, device="cuda") |
| 159 | m = m.to(device="cpu") |
| 160 | self.check(m, orig, ids=False, device="cpu") |
| 161 | |
| 162 | @skip_if_no_cuda |
| 163 | def test_affine_device(self): |