Trait burn::tensor::repr::ReprBackend
pub trait ReprBackend: Backend {
type Handle: Sync + Send + Clone;
// Required methods
fn float_tensor(
handle: TensorHandle<Self::Handle>,
) -> Self::FloatTensorPrimitive;
fn int_tensor(
handle: TensorHandle<Self::Handle>,
) -> Self::IntTensorPrimitive;
fn bool_tensor(
handle: TensorHandle<Self::Handle>,
) -> Self::BoolTensorPrimitive;
fn quantized_tensor(
handle: QuantizedKind<TensorHandle<Self::Handle>>,
scheme: QuantizationScheme,
) -> Self::QuantizedTensorPrimitive;
fn float_tensor_handle(tensor: Self::FloatTensorPrimitive) -> Self::Handle;
fn int_tensor_handle(tensor: Self::IntTensorPrimitive) -> Self::Handle;
fn bool_tensor_handle(tensor: Self::BoolTensorPrimitive) -> Self::Handle;
fn quantized_tensor_handle(
tensor: Self::QuantizedTensorPrimitive,
) -> QuantizedKind<Self::Handle>;
}
Expand description
Backend extension trait that allows an existing backend to use the Burn tensor representation for compilation purpose or other…
Required Associated Types§
Required Methods§
fn float_tensor(
handle: TensorHandle<Self::Handle>,
) -> Self::FloatTensorPrimitive
fn float_tensor( handle: TensorHandle<Self::Handle>, ) -> Self::FloatTensorPrimitive
Convert a handle to a float tensor.
fn int_tensor(handle: TensorHandle<Self::Handle>) -> Self::IntTensorPrimitive
fn int_tensor(handle: TensorHandle<Self::Handle>) -> Self::IntTensorPrimitive
Convert a handle to an int tensor.
fn bool_tensor(handle: TensorHandle<Self::Handle>) -> Self::BoolTensorPrimitive
fn bool_tensor(handle: TensorHandle<Self::Handle>) -> Self::BoolTensorPrimitive
Convert a handle to a bool tensor.
fn quantized_tensor(
handle: QuantizedKind<TensorHandle<Self::Handle>>,
scheme: QuantizationScheme,
) -> Self::QuantizedTensorPrimitive
fn quantized_tensor( handle: QuantizedKind<TensorHandle<Self::Handle>>, scheme: QuantizationScheme, ) -> Self::QuantizedTensorPrimitive
Convert a handle to a quantized tensor.
fn float_tensor_handle(tensor: Self::FloatTensorPrimitive) -> Self::Handle
fn float_tensor_handle(tensor: Self::FloatTensorPrimitive) -> Self::Handle
Convert a float tensor to a handle.
fn int_tensor_handle(tensor: Self::IntTensorPrimitive) -> Self::Handle
fn int_tensor_handle(tensor: Self::IntTensorPrimitive) -> Self::Handle
Convert an int tensor to a handle.
fn bool_tensor_handle(tensor: Self::BoolTensorPrimitive) -> Self::Handle
fn bool_tensor_handle(tensor: Self::BoolTensorPrimitive) -> Self::Handle
Convert a bool tensor to a handle.
fn quantized_tensor_handle(
tensor: Self::QuantizedTensorPrimitive,
) -> QuantizedKind<Self::Handle>
fn quantized_tensor_handle( tensor: Self::QuantizedTensorPrimitive, ) -> QuantizedKind<Self::Handle>
Convert a quantized tensor to a handle. A quantized tensor has multiple handles for the tensor itself and the quantization parameters.
Object Safety§
This trait is not object safe.