as_numpy#
- class saiunit.math.as_numpy(x)#
Convert a JAX array (or
Quantity) to a NumPy array.- Parameters:
x (Quantity or array_like) – The input to convert. If
xis aQuantity, the underlying mantissa (in current unit scale) is returned as a NumPy array.- Returns:
out – NumPy array representation of
x.- Return type:
numpy.ndarray
Examples
>>> import saiunit as u >>> u.math.as_numpy(u.math.ones((3,))) array([1., 1., 1.], dtype=float32)