mrpro.operators.PhaseOp
- class mrpro.operators.PhaseOp[source]
Bases:
EndomorphOperatorPhase of input tensors.
- __call__(*x: Tensor) tuple[Tensor, ...][source]
Calculate the element-wise phase (angle) of input tensors.
- Parameters:
*x (
Tensor) – One or more input tensors. Can be complex or real.- Returns:
A tuple of tensors, where each tensor contains the element-wise phase of the corresponding input tensor. The phase is in radians.
- forward(*x: Tensor) tuple[Tensor, ...][source]
Apply forward of PhaseOp.
Note
Prefer calling the instance of the PhaseOp operator as
operator(x)over directly calling this method. See this PyTorch discussion.
- __add__(other: Operator[Unpack[Tin], Tout]) Operator[Unpack[Tin], Tout][source]
- __add__(other: Tensor | complex) Operator[Unpack[Tin], tuple[Unpack[Tin]]]
Operator addition.
Returns
lambda x: self(x) + other(x)if other is a operator,lambda x: self(x) + other*xif other is a tensor
- __matmul__(other: EndomorphOperator) EndomorphOperator[source]
- __matmul__(other: Operator[Unpack[Tin], Tout]) Operator[Unpack[Tin], Tout]
Operator composition.
- __mul__(other: Tensor | complex) Operator[Unpack[Tin], Tout][source]
Operator multiplication with tensor.
Returns
lambda x: self(x*other)
- __radd__(other: Tensor | complex) Operator[Unpack[Tin], tuple[Unpack[Tin]]][source]
Operator right addition.
Returns
lambda x: other*x + self(x)