concepts.dsl.tensor_value#

Data structures and simple shape-related operations for tensor values. Internally, we use torch.Tensor to represent tensor values.

Functions

concat_tvalues(*args)

expand_as_tvalue(value, other)

expand_pyobj_value(value, batch_variables, ...)

expand_tvalue(value, batch_variables, ...)

from_tensor(value[, dtype, batch_variables, ...])

from_tensorized_pyobj(value[, dtype, ...])

index_pyobj_value(value, indices)

index_tvalue(value, indices)

is_tvalue_simple_quantizable(value)

A value is simple quantizable if it is either quantized, or it has tensor_quantized_values, or it has intrinsically quantized dtypes.

s(value[, dtype])

Alias for scalar().

scalar(value[, dtype])

set_index_pyobj_value(lhs, indices, rhs)

set_index_tvalue(lhs, indices, rhs)

simple_quantize_tvalue(value)

Quantize a value into a quantized value using the simple rules.

t(value[, dtype, batch_variables])

Alias for from_tensor().

v(*args[, dtype])

Alias for values().

vector_values(*args[, dtype])

Classes

MaskedTensorStorage

A storage for quantized tensors.

TensorValue

A value object with an internal torch.Tensor storage.

TensorizedPyObjValues

A value object with nested lists of Python objects.