corewise#

Corewise (per-core) coordinate operations on trees of arrays.

The Euclidean coordinate layer: add/sub/scale/map/sum/dot/norm applied leaf-by-leaf to nested tuples of cores (NDArrayTree), with no dense-tensor semantics – “corewise” is the semantic marker for exactly this. Gotcha: corewise_dot/corewise_norm collapse EVERY axis (stacks included) to a scalar; the corewise_stack_* variants keep a leading stack.

Attributes#

Functions#

corewise_add(X, Y)

Add nested objects, X,Y -> X+Y.

corewise_sub(X, Y)

Subtract nested objects, X,Y -> X-Y.

corewise_scale(X, s)

Scale nested objects, X,s -> s*X.

corewise_zeros_like(X)

Tree of zeros matching X's structure and leaf shapes/backend (= corewise_scale(X, 0)).

corewise_map(f, *Xs)

Apply f elementwise over the leaves of one or more identically-structured trees (the general

corewise_neg(X)

Negate nested objects, X -> -X.

corewise_sum(X[, axis])

Sum each array in a nested object along the given axis or axes, X -> sum(X, axis).

corewise_dot(X, Y)

Dot product of nested objects, X,Y -> X.Y.

corewise_stack_dot(X, Y, n_stack)

Like corewise_dot, but vectorized over the leading n_stack (stack) axes.

corewise_stack_scale(X, s)

Scale each leaf by a per-stack-slice factor s, broadcasting s over each leaf's trailing

corewise_stack_sum(X, axis, n_stack)

Sum each leaf over stack axes, vectorized.

corewise_norm(X)

Norm of nested objects, X -> ||X||

corewise_stack_norm(X, n_stack)

Like corewise_norm(), but vectorized over the leading n_stack (stack) axes.

corewise_err(X_true, X)

corewise_relerr(X_true, X)

corewise_logical_not(X)

Perform logical not operation on nested objects

Module Contents#

NDArrayTree#