integer_pow#
- class brainunit.lax.integer_pow(x, y, **kwargs)#
Elementwise integer power: \(x^y\), where \(y\) is a fixed integer.
- Parameters:
- Returns:
result – The result of
x ** y. Ifxhas unitu, the result has unitu ** y.- Return type:
saiunit.Quantity |
Array- Raises:
TypeError – If
yhas a non-trivial unit.
Examples
>>> import saiunit as u >>> import saiunit.lax as sulax >>> import jax.numpy as jnp >>> q = jnp.array([2.0, 3.0]) * u.meter >>> result = sulax.integer_pow(q, 3) >>> result.mantissa Array([ 8., 27.], dtype=float32)