1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! Common-shape type aliases for [`Tensor`].
//!
//! These aliases are **documentation-only**. The underlying type is the
//! dynamic-rank [`Tensor<T>`](tenflowers_core::Tensor); no compile-time shape
//! enforcement is performed. Names reflect _intent_ (e.g. "matrix" implies 2-D
//! storage), not a distinct type — they are purely ergonomic shorthands.
//!
//! # Example
//!
//! ```rust
//! use tenflowers::type_aliases::*;
//! use tenflowers::prelude::Tensor;
//!
//! let m: Matrix = Tensor::zeros(&[3, 4]);
//! assert_eq!(m.shape().dims(), &[3, 4]);
//! ```
use Tensor;
// ── Generic aliases ──────────────────────────────────────────────────────────
/// A 1-dimensional tensor (vector shape).
///
/// The name signals intent; the underlying type is the dynamic-rank
/// [`Tensor<T>`](tenflowers_core::Tensor).
pub type Tensor1D<T> = ;
/// A 2-dimensional tensor (matrix shape).
///
/// The name signals intent; the underlying type is the dynamic-rank
/// [`Tensor<T>`](tenflowers_core::Tensor).
pub type Tensor2D<T> = ;
/// A 3-dimensional tensor.
///
/// The name signals intent; the underlying type is the dynamic-rank
/// [`Tensor<T>`](tenflowers_core::Tensor).
pub type Tensor3D<T> = ;
/// A 4-dimensional tensor (batch × channels × height × width in vision).
///
/// The name signals intent; the underlying type is the dynamic-rank
/// [`Tensor<T>`](tenflowers_core::Tensor).
pub type Tensor4D<T> = ;
// ── f32 convenience aliases ──────────────────────────────────────────────────
/// A 1-D vector alias using `f32`.
pub type Vector = ;
/// A 2-D matrix alias using `f32`.
pub type Matrix = ;
/// A batch tensor alias using `f32` (first dimension is the batch).
pub type BatchTensor = ;
/// A 1-D tensor of `f32`.
pub type Tensor1Df32 = ;
/// A 2-D tensor of `f32`.
///
/// # Example
///
/// ```rust
/// use tenflowers::type_aliases::Tensor2Df32;
/// use tenflowers::prelude::Tensor;
///
/// let mat: Tensor2Df32 = Tensor::zeros(&[2, 3]);
/// assert_eq!(mat.shape().dims(), &[2, 3]);
/// ```
pub type Tensor2Df32 = ;
/// A 3-D tensor of `f32`.
pub type Tensor3Df32 = ;
/// A 4-D tensor of `f32` (e.g. NCHW image batch).
pub type Tensor4Df32 = ;
// ── f64 convenience aliases ──────────────────────────────────────────────────
/// A 1-D tensor of `f64`.
pub type Tensor1Df64 = ;
/// A 2-D tensor of `f64`.
pub type Tensor2Df64 = ;
/// A 3-D tensor of `f64`.
pub type Tensor3Df64 = ;
/// A 4-D tensor of `f64`.
pub type Tensor4Df64 = ;