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
//! Core tensor types, views, backend traits, and backend-independent contracts.
//!
//! # Owned Tensors And Views
//!
//! [`TypedTensor<T>`](TypedTensor) and the dtype-erased [`Tensor`] enum are
//! owned tensor values. They are the right representation when a result is
//! materialized as compact column-major storage.
//!
//! [`TypedTensorView`] is a borrowed typed view over an existing tensor buffer.
//! It carries logical shape, arbitrary strides, and an offset, so metadata-only
//! layout changes such as transposes, slices, and broadcasts can be represented
//! without copying. A view can be materialized explicitly with
//! [`TypedTensorView::to_contiguous`] when a compact owned tensor is required.
//!
//! [`TensorRead`] is the dtype-erased borrowed input type used by eager kernels
//! and backend dispatch. It can borrow either an owned [`Tensor`] or a
//! [`TensorView`] with arbitrary strides. Prefer `TensorRead` for read-only
//! operation inputs so callers are not forced to materialize layout-only views.
//!
//! [`TensorOwnedView`] and [`TensorValue`] are the owned lazy-value forms. Use
//! them when an API must store a view result beyond the lifetime of a borrowed
//! input, then expose a short-lived `TensorRead` at kernel-dispatch time.
//!
//! Use [`Tensor::as_slice`] or [`TypedTensorView::as_slice`] only when compact
//! contiguous storage is part of the API contract. Use shape/stride-aware kernel
//! paths or `TensorRead` otherwise.
//!
//! # Examples
//!
//! ```rust
//! use tenferro_tensor::{Tensor, TypedTensor};
//!
//! let a = Tensor::F64(TypedTensor::from_vec_col_major(vec![2], vec![1.0, 2.0]).unwrap());
//! assert_eq!(a.shape(), &[2]);
//! ```
/// Lightweight backend-independent host tensor data model.
///
/// Execution-capable tensors and backends in this crate remain separate from
/// the host-only core model during the crate-boundary split.
pub use ;
pub use ;
pub use ;
pub use *;
pub use *;
pub use *;