Skip to content

Conversation

@jmg049
Copy link

@jmg049 jmg049 commented Nov 8, 2025

Tensordot implementation Issue #1517

Adds a full implementation of tensordot for n-dimensional arrays,
supporting both numeric and paired axis specifications via the new
AxisSpec enum. The design mirrors NumPy’s tensordot behaviour while
integrating cleanly with ndarray’s trait-based approach for the dot
product and existing shape and stride logic.

All internal reshaping and permutation operations use unwrap and
expect with explicit safety reasoning: each call is guarded by
dimension and axis validation, ensuring panics can only occur under
invalid AxisSpec input. Documentation and inline comments
describe these invariants and the exact failure conditions.

Includes tests verifying correct contraction for
both paired and integer axis modes.

Adds a full implementation of `tensordot` for n-dimensional arrays,
supporting both numeric and paired axis specifications via the new
`AxisSpec` enum. The design mirrors NumPy’s `tensordot` behaviour while
integrating cleanly with ndarray’s trait-based approach for the ``dot``
product and existing shape and stride logic.

All internal reshaping and permutation operations use `unwrap` and
`expect` with explicit safety reasoning: each call is guarded by
dimension and axis validation, ensuring panics can only occur under
invalid `AxisSpec` input. Documentation and inline comments
describe these invariants and the exact failure conditions.

Includes tests verifying correct contraction for
both paired and integer axis modes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant