Trait burn::tensor::repr::ReprBackend

pub trait ReprBackend: Backend {
    type Handle: Sync + Send + Clone;

    // Required methods
    fn float_tensor<const D: usize>(
        handle: Self::Handle,
        shape: Shape<D>,
    ) -> Self::FloatTensorPrimitive<D>;
    fn int_tensor<const D: usize>(
        handle: Self::Handle,
        shape: Shape<D>,
    ) -> Self::IntTensorPrimitive<D>;
    fn bool_tensor<const D: usize>(
        handle: Self::Handle,
        shape: Shape<D>,
    ) -> Self::BoolTensorPrimitive<D>;
    fn float_tensor_handle<const D: usize>(
        tensor: Self::FloatTensorPrimitive<D>,
    ) -> Self::Handle;
    fn int_tensor_handle<const D: usize>(
        tensor: Self::IntTensorPrimitive<D>,
    ) -> Self::Handle;
    fn bool_tensor_handle<const D: usize>(
        tensor: Self::BoolTensorPrimitive<D>,
    ) -> 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§

type Handle: Sync + Send + Clone

The type that can be used to point to a tensor of any kind.

Required Methods§

fn float_tensor<const D: usize>( handle: Self::Handle, shape: Shape<D>, ) -> Self::FloatTensorPrimitive<D>

Convert a handle to a float tensor.

fn int_tensor<const D: usize>( handle: Self::Handle, shape: Shape<D>, ) -> Self::IntTensorPrimitive<D>

Convert a handle to an int tensor.

fn bool_tensor<const D: usize>( handle: Self::Handle, shape: Shape<D>, ) -> Self::BoolTensorPrimitive<D>

Convert a handle to a bool tensor.

fn float_tensor_handle<const D: usize>( tensor: Self::FloatTensorPrimitive<D>, ) -> Self::Handle

Convert a float tensor to a handle.

fn int_tensor_handle<const D: usize>( tensor: Self::IntTensorPrimitive<D>, ) -> Self::Handle

Convert an int tensor to a handle.

fn bool_tensor_handle<const D: usize>( tensor: Self::BoolTensorPrimitive<D>, ) -> Self::Handle

Convert a bool tensor to a handle.

Object Safety§

This trait is not object safe.

Implementors§

§

impl<R, F, I> ReprBackend for JitBackend<R, F, I>
where R: JitRuntime, F: FloatElement, I: IntElement,

§

type Handle = JitFusionHandle<R>