Skip to main content

Module zspace

Module zspace 

Source
Expand description

§Common ZSpace Utilities for Ruda

This is a new/experimental module.

The goal will be to unify:

  • shape/stride construction/validation.
  • stride map view transformations.
  • common Shape types.
  • common Shape/Size/Reshape utility traits.

The intention is to publish this as a stand-alone zspace module, with no direct tie to ruda; once it is more polished.

Modules§

dtype
Tensor data type.
errors
Common Ruda Errors
indexing
Indexing Utilities
metadata
primitive
quantization
Quantization data representation.
shape
Tensor shape definition.
slice
Tensor slice utilities.
spatial
striding
Stride Utilities

Macros§

s
Slice argument constructor for tensor indexing.
shape
smallvec
Creates a SmallVec containing the arguments.
strides

Structs§

BlockSize
Copyable block size, specialized version of SmallVec.
FloatInfo
Numerical precision properties for a floating-point dtype.
Metadata
QParamTensor
A quantization parameter tensor descriptor.
QParams
The quantization tensor data parameters.
QuantScheme
Describes a quantization scheme/configuration.
Shape
Shape of a tensor.
Slice
A slice specification for a single tensor dimension.
SliceIter
Defines an Iterator over a Slice.
SmallVec
A Vec-like container that can store a small number of elements inline.
Strides

Enums§

BoolStore
Data type used to store boolean values.
DType
ExpressionError
Common Expression Error.
FloatDType
IntDType
MetadataError
Error that can occur when attempting to modify shapes.
QuantAcc
The precision of accumulating elements.
QuantLevel
Level or granularity of quantization.
QuantMode
Strategy used to quantize values.
QuantParam
Quantization floating-point precision.
QuantPropagation
Specify if the output of an operation is quantized using the scheme of the input or returned unquantized.
QuantStore
Data type used to stored quantized values.
QuantValue
Data type used to represent quantized values.
ReshapeAction
The action to take for a reshape operation.
ReshapeAnalysis
The reshape kind.

Constants§

QPARAM_ALIGN
Alignment (in bytes) for quantization parameters in serialized tensor data.

Traits§

QTensorPrimitive
Quantized tensor primitive.
SliceArg
Trait for slice arguments that can be converted into an array of slices. This allows the slice method to accept both single slices (from s![..]) and arrays of slices (from s![.., ..] or [0..5, 1..3]).
SliceOps
Slice-related ops on Shape
TensorMetadata
Tensor metadata trait for tensor primitive.

Functions§

broadcast_strides
Calculate the new strides given added batch dimensions.
calculate_matmul_output
Compute the output shape for matrix multiplication with broadcasting support.
contiguous_strides
Computes the strides for a contiguous tensor with the given shape.
is_contiguous
Check if the current tensor is contiguous.
pack_i8s_to_u32s
Pack signed 8-bit integer values into a sequence of unsigned 32-bit integers.
params_shape
Calculate the shape of the quantization parameters for a given tensor and level
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.

Type Aliases§

BoolDType
Boolean dtype.