MCPcopy Index your code
hub / github.com/Project-MONAI/MONAI / as_tensor

Method as_tensor

monai/data/meta_tensor.py:349–354  ·  view source on GitHub ↗

Return the `MetaTensor` as a `torch.Tensor`. It is OS dependent as to whether this will be a deep copy or not.

(self)

Source from the content-addressed store, hash-verified

347 return torch.eye(4, device=torch.device("cpu"), dtype=dtype)
348
349 def as_tensor(self) -> torch.Tensor:
350 """
351 Return the `MetaTensor` as a `torch.Tensor`.
352 It is OS dependent as to whether this will be a deep copy or not.
353 """
354 return self.as_subclass(torch.Tensor)
355
356 def get_array(self, output_type=np.ndarray, dtype=None, device=None, *_args, **_kwargs):
357 """

Callers 15

new_emptyMethod · 0.95
cloneMethod · 0.95
__repr__Method · 0.95
__str__Method · 0.95
__format__Method · 0.95
test_numpyMethod · 0.95
_torch_all_gatherFunction · 0.80
_convert_tensorFunction · 0.80
__init__Method · 0.80
__init__Method · 0.80
forwardMethod · 0.80
forwardMethod · 0.80

Calls

no outgoing calls

Tested by 15

test_numpyMethod · 0.76
compare_2dFunction · 0.64
test_to_norm_affineMethod · 0.64
test_zoomMethod · 0.64
test_zoom_1Method · 0.64
test_zoom_2Method · 0.64
test_zoom_zero_centerMethod · 0.64