# enp

[[[Source]]](https://github.com/google/etils/tree/main/etils/enp/__init__.py)

```{code-block}
from etils import enp
```

```{eval-rst}
.. automodule:: etils.enp
  :no-members:
```

## All symbols


### Module

|  |  |
--- | ---
[enp](index) | Numpy API.
[enp.compat](compat/index) | Compat utils between TF/Torch/Numpy/Jax.
[enp.dtypes](dtypes/index) | Dtype utils.
[enp.linalg](linalg/index) | `linalg` compat module for interoperability between tf, jax, numpy.
[enp.typing](typing/index) | Typing utils.

### Class

|  |  |
--- | ---
[enp.ArraySpec](ArraySpec) | Structure containing shape/dtype.
[enp.NpModule](NpModule) | Special type indicating an unconstrained type.
[enp.dtypes.AnyDType](dtypes/AnyDType) | DType which can represent any dtype.
[enp.dtypes.AnyFloat](dtypes/AnyFloat) | Generic float dtype (float32, float64, bfloat16,...).
[enp.dtypes.AnyInt](dtypes/AnyInt) | Generic int dtype (int32, int64, uint8,...).
[enp.dtypes.Casting](dtypes/Casting) | Casting mode when converting to array.
[enp.dtypes.DType](dtypes/DType) | DType wrapper.
[enp.dtypes.NpDType](dtypes/NpDType) | Raw numpy dtype.
[enp.typing.Array](typing/Array) | 
[enp.typing.ArrayAliasMeta](typing/ArrayAliasMeta) | Metaclass to create array aliases.
[enp.typing.BoolArray](typing/BoolArray) | 
[enp.typing.FloatArray](typing/FloatArray) | 
[enp.typing.IntArray](typing/IntArray) | 
[enp.typing.PRNGKey](typing/PRNGKey) | 
[enp.typing.StrArray](typing/StrArray) | 
[enp.typing.bool_](typing/bool_) | 
[enp.typing.complex128](typing/complex128) | 
[enp.typing.complex64](typing/complex64) | 
[enp.typing.f16](typing/f16) | 
[enp.typing.f32](typing/f32) | 
[enp.typing.f64](typing/f64) | 
[enp.typing.i16](typing/i16) | 
[enp.typing.i32](typing/i32) | 
[enp.typing.i64](typing/i64) | 
[enp.typing.i8](typing/i8) | 
[enp.typing.ui16](typing/ui16) | 
[enp.typing.ui32](typing/ui32) | 
[enp.typing.ui64](typing/ui64) | 
[enp.typing.ui8](typing/ui8) | 

### Function

|  |  |
--- | ---
[enp.angle_between](angle_between) | Compute angle between 2 vectors, unsigned.
[enp.batch_dot](batch_dot) | Dot product on the last dimension, with broadcasting support.
[enp.check_and_normalize_arrays](check_and_normalize_arrays) | Check and normalize arrays.
[enp.compat.astype](compat/astype) | `x.astype(dtype)`.
[enp.compat.concat](compat/concat) | `xnp.concatenate(x, axis=axis)`.
[enp.compat.det](compat/det) | Like `np.linalg.det` but auto-support jnp, tnp, np.
[enp.compat.dtype_np_to_torch](compat/dtype_np_to_torch) | Returns the torch dtype for the given numpy dtype.
[enp.compat.dtype_torch_to_np](compat/dtype_torch_to_np) | Returns the numpy dtype for the given torch dtype.
[enp.compat.expand_dims](compat/expand_dims) | `xnp.expand_dims(x, axis=axis)`.
[enp.compat.inv](compat/inv) | Like `np.linalg.inv` but auto-support jnp, tnp, np.
[enp.compat.is_array_xnp](compat/is_array_xnp) | `isinstance(x, xnp.Array)`.
[enp.compat.norm](compat/norm) | Like `np.linalg.norm` but auto-support jnp, tnp, np.
[enp.compat.round](compat/round) | `x.round()` for jnp, tnp, np, otrch.
[enp.flatten](flatten) | Flatten an array along custom dimensions.
[enp.get_np_module](get_np_module) | Returns the numpy module associated with the given array.
[enp.interp](interp) | Linearly scale the given value by the given range.
[enp.is_array](is_array) | Returns `True` if array is np or `jnp` array.
[enp.is_array_str](is_array_str) | Returns True if the given array is a `str` array.
[enp.is_dtype_str](is_dtype_str) | Returns True if the dtype is `str`.
[enp.linalg.normalize](linalg/normalize) | Normalize the vector to the unit norm.
[enp.normalize_bytes2str](normalize_bytes2str) | Normalize `bytes` array to `str` (UTF-8).
[enp.project_onto_plane](project_onto_plane) | Project `u` onto the plane `n` (orthogonal vector).
[enp.project_onto_vector](project_onto_vector) | Project `u` onto `v`.
[enp.unflatten](unflatten) | 

### Attribute

|  |  |
--- | ---
[enp.compat.lazy](compat/lazy) | 
[enp.lazy](lazy) | 
[enp.linalg.lazy](linalg/lazy) | 
[enp.tau](tau) | Mirror math.tau (PEP 628). See https://tauday.com/

### Typing

|  |  |
--- | ---
[enp.typing.ArrayLike](typing/ArrayLike) | ArrayLike indicates that any `np.array` input is also supported. For example: `A...


```{toctree}
:hidden:

ArraySpec
NpModule
angle_between
batch_dot
check_and_normalize_arrays
compat/index
dtypes/index
flatten
get_np_module
interp
is_array
is_array_str
is_dtype_str
lazy
linalg/index
normalize_bytes2str
project_onto_plane
project_onto_vector
tau
typing/index
unflatten
```