Skip to main content

Module api

Module api 

Source
Available on crate feature api only.
Expand description

Public tensor API built on the shared backend contracts and primitives.

Re-exports§

pub use crate::TensorPrimitive;
pub use crate::ops::TransactionPrimitive;
pub use crate::tensor::Bool;
pub use crate::tensor::Float;
pub use crate::tensor::Int;
pub use crate::tensor::TensorKind;
pub use ops::Device;
pub use crate::get_device_settings;
pub use crate::set_default_dtypes;
pub use crate::tensor::BasicAutodiffOps;
pub use crate::tensor::BasicOps;
pub use crate::tensor::Numeric;
pub use crate::indexing::*;
pub use crate::shape::*;
pub use crate::slice::*;

Modules§

activation
The activation module.
backend
The backend module.
cast
Tensor element casting.
container
The container module.
grid
The grid module.
linalg
The linalg module.
loss
The loss module.
module
The neural network module.
ops
Operations on tensors module.
quantization
Tensor quantization module.
signal
The signal processing module.
sparse

Structs§

Bytes
A buffer similar to Box<[u8]> that supports custom memory alignment and allows trailing uninitialized bytes.
DeviceSettings
Settings controlling the default data types for a specific device.
DimIter
Iterator given by (Tensor::iter_dim).
DistributionSampler
Distribution sampler for random value of a tensor.
PrintOptions
Options for Tensor pretty printing
StreamId
Unique identifier that can represent a stream based on the current thread id.
Tensor
A tensor with a given backend, shape and data type.
TensorCreationOptions
Options for tensor creation.
TensorData
Data structure for tensors.
Tolerance
The tolerance used to compare to floating point numbers.
Transaction
A transaction can read multiple tensors at once with a single operation improving compute utilization with optimized laziness.
bf16
A 16-bit floating point type implementing the bfloat16 format.
f16
A 16-bit floating point type implementing the IEEE 754-2008 standard binary16 a.k.a “half” format.

Enums§

AllocationProperty
The kind of allocation behind the Bytes type.
BoolStore
Data type used to store boolean values.
DType
DataError
The things that can go wrong when manipulating tensor data.
Distribution
Distribution for random value of a tensor.
DistributionSamplerKind
Distribution sampler kind for random value of a tensor.
FloatDType
IndexingUpdateOp
Computation to be used to update the existing values in indexed assignment operations (scatter/select).
IntDType
Scalar
A scalar element.

Constants§

DEFAULT_ATOL
Default ATOL value for is_close and all_close.
DEFAULT_RTOL
Default RTOL value for is_close and all_close.

Traits§

BroadcastArgs
Trait used for broadcast arguments.
Cast
Trait for types that represent a valid cast target from a tensor of kind K.
Element
Core element trait for tensor values.
ElementComparison
Element ordering trait.
ElementConversion
Element conversion trait for tensor.
ElementEq
Element trait for equality of a tensor.
ElementLimits
Element limits trait.
ElementOrdered
Ordered element trait for tensor values.
ElementRandom
Element trait for random value of a tensor.
IntoPadding
Trait for types that can be used as padding specifications.
MovedimArgs
Trait used for movedim arguments
ReshapeArgs
Trait used for reshape arguments.
TensorMetadata
Tensor metadata trait for tensor primitive.

Functions§

cartesian_grid
Generates a cartesian grid for the given tensor shape on the specified device. The generated tensor is of dimension D2 = D + 1, where each element at dimension D contains the cartesian grid coordinates for that element.
check_closenessapi-std
Checks the closeness of two tensors and prints the results.
read_sync
Read a future synchronously.
set_print_options
Set print options
try_read_sync
Read a future synchronously.

Type Aliases§

BoolDType
Boolean dtype.