(self, device, dtype)
| 167 | |
| 168 | @parameterized.expand(TESTS) |
| 169 | def test_copy(self, device, dtype): |
| 170 | m, _ = self.get_im(device=device, dtype=dtype) |
| 171 | # shallow copy |
| 172 | a = m |
| 173 | self.check(a, m, ids=True) |
| 174 | # deepcopy |
| 175 | a = deepcopy(m) |
| 176 | self.check(a, m, ids=False) |
| 177 | # clone |
| 178 | a = m.clone(memory_format=torch.preserve_format) |
| 179 | a = m.clone() |
| 180 | self.check(a, m, ids=False) |
| 181 | a = MetaTensor([[]], device=device, dtype=dtype) |
| 182 | self.check(a, deepcopy(a), ids=False) |
| 183 | |
| 184 | @parameterized.expand(TESTS) |
| 185 | def test_add(self, device, dtype): |
nothing calls this directly
no test coverage detected