RusTorch v0.6.28 - tensor_nd! Procedural Macro for N-Dimensional Tensors
RusTorch v0.6.28 Release
π New Features
tensor_nd! Procedural Macro
Introduces a powerful new procedural macro for creating N-dimensional tensors with compile-time shape inference.
use rustorch::tensor_nd;
// 4D tensor: shape [2, 2, 2, 2]
let t4 = tensor_nd!([
[[[1, 2], [3, 4]], [[5, 6], [7, 8]]],
[[[9, 10], [11, 12]], [[13, 14], [15, 16]]]
]);
// 6D tensor: shape [1, 1, 1, 1, 1, 2]
let t6 = tensor_nd!([[[[[[1, 2]]]]]]);β¨ Key Features
- π¦ Support for N-dimensional tensors (1D through 8D and beyond)
- π Compile-time shape inference from nested array literals
- π Automatic numeric type conversion to f32
- π― Mixed numeric types support (integers and floats)
- ποΈ New
rustorch-macrosworkspace member for procedural macros
π§ͺ Testing
- β 10 integration tests covering dimensions 1D through 8D
- β All 1143 library tests passing
- β Full example suite verified
π Documentation
- Comprehensive doc tests and examples
- Updated README with usage examples
- Release workflow documentation
π§ Technical Implementation
- Uses
syn,quote, andproc-macro2for macro implementation - Recursive array flattening algorithm
- Re-exported in main rustorch crate for easy access
π¦ Installation
Add to your Cargo.toml:
rustorch = "0.6.28"π Links
π€ Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com