Trait MultiBackendBridge

Source
pub trait MultiBackendBridge:
    Send
    + Sync
    + 'static {
    type TensorHandle;
    type Device: DeviceOps;

    // Required methods
    fn change_backend_float(
        tensor: Self::TensorHandle,
        shape: Shape,
        target_device: &Self::Device,
    ) -> Self::TensorHandle;
    fn change_backend_int(
        tensor: Self::TensorHandle,
        shape: Shape,
        target_device: &Self::Device,
    ) -> Self::TensorHandle;
    fn change_backend_bool(
        tensor: Self::TensorHandle,
        shape: Shape,
        target_device: &Self::Device,
    ) -> Self::TensorHandle;
}
Expand description

Allows tensors to be transferred between multiple backends.

Required Associated Types§

Source

type TensorHandle

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

Source

type Device: DeviceOps

Device type used by the backends.

Required Methods§

Source

fn change_backend_float( tensor: Self::TensorHandle, shape: Shape, target_device: &Self::Device, ) -> Self::TensorHandle

Change the backend of the given float tensor.

Source

fn change_backend_int( tensor: Self::TensorHandle, shape: Shape, target_device: &Self::Device, ) -> Self::TensorHandle

Change the backend of the given int tensor.

Source

fn change_backend_bool( tensor: Self::TensorHandle, shape: Shape, target_device: &Self::Device, ) -> Self::TensorHandle

Change the backend of the given bool tensor.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§