acos_op
Structs
Struct: ACos
Fields
Methods
fwd(arg0: Array) -> Array
Computes the arccosine of the input array element-wise.
jvp(primals: List[Array], tangents: List[Array]) -> Array
Computes the Jacobian-vector product for the arccosine function.
Args
-
primals
:List[Array]
A list containing the primal input array. -
tangents
:List[Array]
A list containing the tangent vector.
Returns
Array
- The Jacobian-vector product for the arccosine function.
Implements forward-mode automatic differentiation for the arccosine function.
Note: The Jacobian-vector product for arccosine is computed as -1 / sqrt(1 - x^2) * dx, where x is the primal input and dx is the tangent vector.
vjp(primals: List[Array], grad: Array, out: Array) -> List[Array]
Computes the vector-Jacobian product for the arccosine function.
Args
-
primals
:List[Array]
A list containing the primal input array. -
grad
:Array
The gradient of the output with respect to some scalar function. -
out
:Array
The output of the forward pass (unused in this function).
Returns
List[Array]
- A list containing the gradient with respect to the input.
Implements reverse-mode automatic differentiation for the arccosine function.
Note: The vector-Jacobian product for arccosine is computed as -1 / sqrt(1 - x^2) * grad, where x is the primal input and grad is the incoming gradient.
unary_simd_op(arg0_real: SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], arg0_imag: SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]) -> Tuple[SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]]
Low-level function to compute the arccosine of a complex number represented as SIMD vectors.
Args
-
arg0_real
:SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]
The real part of the complex number. -
arg0_imag
:SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]
The imaginary part of the complex number.
Returns
Tuple[SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]]
- The real and imaginary parts of the arccosine of the complex number as a tuple.
__call__(mut curr: Array, args: List[Array])
Performs the forward pass for element-wise arccosine computation of an array.
Args
-
curr
:Array
The current array to store the result (modified in-place). -
args
:List[Array]
A list containing the input array.
Computes the arccosine of each element in the input array and stores the result in the current array. Initializes the current array if not already set up.
Note: This function assumes that the shape and data of the args are already set up. If the current array (curr) is not initialized, it computes the shape based on the input array and sets up the data accordingly.
Functions
acos
acos(arg0: Array) -> Array