Crate hpt

Source
Expand description

This crate is dynamic graph based tensor library

Re-exports§

pub use tensor::Tensor;
pub use flate2;
pub use serde;

Modules§

arch_simd
A module defines a set of vector types using stdsimd
ops
a module contains all the Tensor operations. include the CPU and GPU operations
random
A module contains random number generation operations
shape_manipulate
A module contains shape manipulation operations
tensor
a module that wrap the _Tensor struct
tensor_base
a module that defines the _Tensor struct
to_tensor
a module that contains the implementation of the Into trait for the _Tensor struct.
traits
A module defines a set of traits for vector
utils
A module defines a set of utils for vector

Macros§

select
parse the input and generate the corresponding slice

Structs§

Backend
backend of tensor
Cpu
Cpu backend
DataLoader
Shape
Represents the shape of a multi-dimensional structure, such as a tensor or an array.
Strides
Represents the strides of a multi-dimensional structure, such as a tensor or an array.
TensorLoader
TensorSaver

Enums§

CompressionAlgo
Endian
TensorError
Base error type for all tensor operations

Traits§

AdvancedOps
A trait contains advance operations
Allocator
traits for the allocator
AllocatorOutputRetrive
traits for the allocator output retrive
BackendTy
backend id trait
BitWiseOut
this trait is used to perform bitwise operations
Buffer
trait for buffer
Cast
A trait for converting a scalar into another scalar type.
CommonBounds
Common bounds for primitive types
Concat
trait for concat
Conv
trait for conv operations
ConvDiff
trait for differentiable conv operations
Cum
A trait for accumulative operations.
CumulativeOps
A trait for cumulative operations
Eval
this trait is used to perform evaluation operations
EvalReduce
A trait for tensor reduction operations, the output must be a boolean tensor.
FFTOps
A trait for Fast Fourier Transform (FFT) operations.
FloatBinOps
A trait for binary operations on tensors.
FloatOutBinary
this trait is used to perform type promotion in dynamic graph
FloatOutBinaryPromote
this trait is used to perform type promotion for float out binary operations
FloatOutPooling
trait for pooling that the output type is the same as the input type
FloatOutUnary
This trait is used to perform various unary floating-point operations.
FloatOutUnaryPromote
this trait is used to promote the float out unary trait to the output type
FloatReduce
A trait for tensor reduction operations, the output must be a floating-point tensor.
FloatUnaryOps
A trait for tensor unary operations, the output must be a floating point tensor
FromSafeTensors
HardMax
A trait for hardmax
IndexReduce
A trait typically for argmax and argmin functions.
IntoVec
a trait to convert a vector to another vector
IterGetSet
A trait for getting and setting values from an iterator.
IterGetSetSimd
A trait for getting and setting values from an simd iterator
Load
Matmul
A trait for matrix multiplication operations on tensors.
MetaLoad
NormalBinOps
A trait for binary operations on tensors.
NormalEvalReduce
A trait for tensor reduction operations, the output must remain the same tensor type.
NormalOut
this trait is used to perform normal operations that don’t require type promotion
NormalOutPromote
this trait is used to perform type promotion for normal out operations
NormalOutUnary
this trait is used to perform normal unary operations that don’t require type promotion
NormalPooling
trait for pooling that the output type is the same as the input type
NormalReduce
A trait for normal tensor reduction operations.
NormalUaryOps
A trait for unary operations, the output must be the same type as the input.
ParStridedIteratorSimd
A trait for performing single thread simd iteration over an iterator.
ParStridedIteratorSimdZip
A trait to zip two parallel iterators together.
ParStridedIteratorZip
A trait to zip two parallel iterators together.
Random
A trait for generating random numbers.
RandomInt
A trait for generating random integers.
Save
ShapeManipulate
A trait for manipulating the shape of a tensor.
ShapeManipulator
A trait for performing shape manipulation on an iterator.
Shrinkage
A trait for shrinkage
Slice
trait for slicing tensor
StridedIterator
A trait for performing single thread iteration over an iterator.
StridedIteratorMap
A trait to map a function on the elements of an iterator.
StridedIteratorSimd
A trait for performing single thread simd iteration over an iterator.
StridedIteratorZip
A trait to zip two iterators together.
StridedSimdIteratorZip
A trait to zip two simd iterators together.
TensorAlloc
A trait for tensor memory allocation, this trait only used when we work with generic type
TensorCmp
A trait for tensor comparison operations
TensorCreator
A trait defines a set of functions to create tensors.
TensorDot
A trait for tensor dot operations on tensors.
TensorInfo
A trait for getting information of a Tensor
TensorIterator
A trait for converting a tensor into an iterator.
TensorLike
A trait for let the object like a tensor
TensorWhere
A trait for tensor where
TypeCommon
common trait for all data types
VecTrait
common trait for all vector types
WindowOps
A trait contains window operations

Functions§

binary_with_out
Perform binary operation with output tensor
get_num_threads
Get the global number of threads
parse_header_compressed
resize_cpu_lru_cache
resize the lru cache of the cpu allocator
set_display_elements
Set the left and right elements to display for each dimension
set_display_precision
Set the Tensor display precision
set_num_threads
Set the global number of threads
set_seed
Set the seed for random number generation

Derive Macros§

Load
generate load trait
Save
generate save trait