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

Function complex_abs

monai/apps/reconstruction/complex_utils.py:117–135  ·  view source on GitHub ↗

Compute the absolute value of a complex array. Args: x: Input array/tensor with 2 channels in the last dimension representing real and imaginary parts. Returns: Absolute value along the last dimension Example: .. code-block:: python import num

(x: NdarrayOrTensor)

Source from the content-addressed store, hash-verified

115
116
117def complex_abs(x: NdarrayOrTensor) -> NdarrayOrTensor:
118 """
119 Compute the absolute value of a complex array.
120
121 Args:
122 x: Input array/tensor with 2 channels in the last dimension representing real and imaginary parts.
123
124 Returns:
125 Absolute value along the last dimension
126
127 Example:
128 .. code-block:: python
129
130 import numpy as np
131 x = np.array([3,4])[np.newaxis]
132 # the following line prints 5
133 print(complex_abs(x))
134 """
135 return complex_abs_t(x) # type: ignore
136
137
138def complex_mul_t(x: Tensor, y: Tensor) -> Tensor:

Callers 3

__call__Method · 0.90
__call__Method · 0.90
test_complex_absMethod · 0.90

Calls 1

complex_abs_tFunction · 0.85

Tested by 1

test_complex_absMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…