Skip to content

API Reference

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

Modules

Module What it exports
bearshape Dimensions, structures, dtype specs, factories and memo helpers
bearshape.numpy NumPy arrays, Like and ScalarLike aliases, Structured and ArrayLike
bearshape.jax JAX arrays, Like aliases, ScalarLike re-exports and Tree
bearshape.torch Torch arrays, Like aliases and ScalarLike re-exports
bearshape.cupy CuPy arrays, Like aliases and ScalarLike re-exports
bearshape.optree Explicit Tree backend and Structure
bearshape.claw Caller-preserving alias of 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.