Skip to content

API Reference

This section is intentionally organized by import boundary, not by internal implementation file.

Modules

| Module | What it exports | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | bearshape | Lightweight root API: dimension symbols, structure symbols, DtypeSpec, make_array_type, make_array_like_type, check, check_context, and __version__ | | bearshape.numpy | NumPy array aliases, Like aliases, ScalarLike aliases, Structured, ArrayLike, and make_scalar_like_type | | bearshape.jax | JAX array aliases, JAX Like aliases, NumPy ScalarLike re-exports, make_scalar_like_type, Tree, and Structure | | bearshape.torch | PyTorch array aliases, Torch Like aliases, NumPy ScalarLike re-exports, and make_scalar_like_type | | bearshape.cupy | CuPy array aliases, CuPy Like aliases, NumPy ScalarLike re-exports, and make_scalar_like_type | | bearshape.optree | Explicit Tree backend using OpTree plus Structure | | bearshape.claw | Thin wrapper around beartype.claw.beartype_this_package |

Important boundaries

  • The root bearshape import is optional-dependency-safe and does not require NumPy.
  • Tree is not exported from the root module. Import it from bearshape.optree or bearshape.jax.
  • make_scalar_like_type is not exported from the root module. Import it from bearshape.numpy or a backend module that re-exports it.