Skip to main content

Module tensor

Module tensor 

Source
Expand description

Tensor utilities.

Re-exports§

pub use dtype::*;
pub use quantization::*;
pub use shape::*;
pub use slice::*;

Modules§

dtype
Tensor data type.
indexing
Indexing Utilities
quantization
Quantization data representation.
shape
Tensor shape definition.
slice
Tensor slice utilities.

Macros§

strides

Structs§

IndexWrap
Wraps an index with negative indexing support.
Metadata
Strides

Enums§

ReshapeAction
The action to take for a reshape operation.
ReshapeAnalysis
The reshape kind.

Traits§

AsIndex
Helper trait for implementing indexing with support for negative indices.
AsSize
Types which can be converted to a usize Size.

Functions§

broadcast_strides
Calculate the new strides given added batch dimensions.
contiguous_strides
Computes the strides for a contiguous tensor with the given shape.
is_contiguous
Check if the current tensor is contiguous.
ravel_index
Compute the ravel index for the given coordinates.
reshape_action
Returns the proper action to take when reshaping a tensor.
reshape_analysis
Returns the analysis of a reshape operation.
split_strides
Calculate the new strides given added split dimensions.
wrap_index
Wraps a dimension index to be within the bounds of the dimension size.