boundlab.utils#
Shared utilities: shape metadata, einsum plumbing, polynomials, formatting.
Module Attributes
A tensor dimension: a plain |
Functions
Whether every element equals the first (vacuously true when empty). |
|
Whether no element repeats. |
|
Runtime-checked cast: dies (via beartype) if |
|
Format input tuples followed by one output tuple as an einsum string. |
|
Parse an einsum string into input tuples followed by one output tuple. |
|
Format a byte count as a human-readable string (e.g. |
|
Return whether a concrete scalar/tensor contains only zeros. |
|
Whether two shapes agree, comparing symbolic dimensions by string. |
|
Sum with |
|
Assert an |
|
Transpose an iterable of equal-length tuples into per-slot lists. |
Classes
A tensor dimension: a plain |
|
Dense univariate polynomial \(P(x) = \sum_k c_k x^k\). |
|
Allocation-free shape and dtype metadata for an abstract expression. |
|
A format string plus the traced arrays that fill its placeholders. |
|
Dictionary whose values are indexed by their concrete types. |