kornia_tensor/
lib.rs

1#![deny(missing_docs)]
2#![doc = env!("CARGO_PKG_DESCRIPTION")]
3
4/// allocator module containing the memory management utilities.
5pub mod allocator;
6
7/// bincode module containing the serialization and deserialization utilities.
8#[cfg(feature = "bincode")]
9pub mod bincode;
10
11/// serde module containing the serialization and deserialization utilities.
12#[cfg(feature = "serde")]
13pub mod serde;
14
15/// storage module containing the storage implementations.
16pub mod storage;
17
18/// tensor module containing the tensor and storage implementations.
19pub mod tensor;
20
21/// view module containing the view implementations.
22pub mod view;
23
24pub use crate::allocator::{CpuAllocator, TensorAllocator};
25pub(crate) use crate::tensor::get_strides_from_shape;
26pub use crate::tensor::{Tensor, TensorError};
27
28/// Type alias for a 1-dimensional tensor.
29pub type Tensor1<T, A> = Tensor<T, 1, A>;
30
31/// Type alias for a 2-dimensional tensor.
32pub type Tensor2<T, A> = Tensor<T, 2, A>;
33
34/// Type alias for a 3-dimensional tensor.
35pub type Tensor3<T, A> = Tensor<T, 3, A>;
36
37/// Type alias for a 4-dimensional tensor.
38pub type Tensor4<T, A> = Tensor<T, 4, A>;
39
40/// Type alias for a 2-dimensional tensor with CPU allocator.
41pub type CpuTensor2<T> = Tensor2<T, CpuAllocator>;