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

Method array

monai/data/meta_tensor.py:395–404  ·  view source on GitHub ↗

Returns a numpy array of ``self``. The array and ``self`` shares the same underlying storage if self is on cpu. Changes to ``self`` (it's a subclass of torch.Tensor) will be reflected in the ndarray and vice versa. If ``self`` is not on cpu, the call will move the array to c

(self)

Source from the content-addressed store, hash-verified

393
394 @property
395 def array(self):
396 """
397 Returns a numpy array of ``self``. The array and ``self`` shares the same underlying storage if self is on cpu.
398 Changes to ``self`` (it's a subclass of torch.Tensor) will be reflected in the ndarray and vice versa.
399 If ``self`` is not on cpu, the call will move the array to cpu and then the storage is not shared.
400
401 :getter: see also: :py:func:`MetaTensor.get_array()`
402 :setter: see also: :py:func:`MetaTensor.set_array()`
403 """
404 return self.get_array()
405
406 @array.setter
407 def array(self, src) -> None:

Callers 15

_order_templateMethod · 0.80
raster_scan_idxMethod · 0.80
s_curve_idxMethod · 0.80
random_idxMethod · 0.80
label_unionFunction · 0.80
__init__Method · 0.80
gen_mtxMethod · 0.80
get_ram_cost_usageMethod · 0.80
_check_input_sizeMethod · 0.80
scales_for_resolutionFunction · 0.80
shape_factorMethod · 0.80
set_timestepsMethod · 0.80

Calls 2

get_arrayMethod · 0.95
set_arrayMethod · 0.95

Tested by 15

test_neg_strideMethod · 0.64
test_set_stateMethod · 0.64
test_set_exclude_varsMethod · 0.64
test_set_map_acrossMethod · 0.64
test_set_prefixMethod · 0.64
testMethod · 0.64
testMethod · 0.64
test_gradientMethod · 0.64
test_1dMethod · 0.64
test_2dMethod · 0.64
test_3dMethod · 0.64
test_1dMethod · 0.64