pow

dragon.math.pow(
  inputs,
  **kwargs
)[source]

Compute the power of input.

\[\text{out} = \text{input}^{\text{exponent}} \]

The two inputs should be broadcast to each other:

x = dragon.fill(shape=(1, 2), value=2)
print(dragon.math.pow([x, x]))  # [[4, 4]]
print(dragon.math.pow([x, 3]))  # [[8, 8]]
print(dragon.math.pow([3, x]))  # [[9, 9]]
Parameters:
  • inputs (Sequence[dragon.Tensor]) The input and exponent tensor.
Returns:

dragon.Tensor The output tensor.