MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_copy

Method test_copy

tests/data/meta_tensor/test_meta_tensor.py:169–182  ·  view source on GitHub ↗
(self, device, dtype)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 4

get_imMethod · 0.95
checkMethod · 0.95
MetaTensorClass · 0.90
cloneMethod · 0.80

Tested by

no test coverage detected