Power (Pow)#

API#

class warp_nn.modules.operators.Pow(*, requires_grad: bool = True)[source]#

Bases: Module

Power (Pow) operation.

This class computes the element-wise power (the input raised to the exponent):

\[\text{Pow}(x, y) = x^y\]
Parameters:

requires_grad – Whether the cached output arrays of the module require gradients.

__call__(
x: array,
y: array,
) → array[source]#

Forward pass of the operation.

Parameters:
  • x – The base array, with up to 3 dimensions.

  • y – The exponent array, with the same shape and data type as x.

Returns:

The output array, with same shape as the input arrays.

Raises:
  • ValueError – If the input arrays’ shapes differ.

  • TypeError – If the input arrays’ data types differ, or if their data type or number of dimensions is not supported.