pow

Graph.pow(x, y, *, name=None)

Calculates the element-wise power between numbers, np.ndarrays, Tensors, Pwcs, or Stfs. You can also use the arithmetic operator ** to calculate their power.

Considering numbers and np.ndarrays as Tensors, if the two objects are of the same type, so is the returned object. If the objects have different types, Pwcs and Stfs can operate with a tensor (returning a Pwc or Stf, respectively).

This operation supports broadcasting between the different objects. When operating a tensor-like object with an Stf or a Pwc, the time dimension of the latter is ignored.

Parameters
  • x (number or np.ndarray or Tensor or Pwc or Stf) – The base, \(x\).

  • y (number or np.ndarray or Tensor or Pwc or Stf) – The exponent, \(y\).

  • name (str, optional) – The name of the node. You can only provide a name if neither x nor y are Stfs.

Returns

The element-wise power \(x^y\).

Return type

Tensor or Pwc or Stf

Warning

This function considers that the zeroth power of zero (\(0^0\)) is undefined. This means that you might see an error if you attempt to fetch an object that contains \(0^0\).