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§
Sourcetype TensorHandle
type TensorHandle
The type that can be used to point to a tensor of any kind.
Required Methods§
Sourcefn change_backend_float(
tensor: Self::TensorHandle,
shape: Shape,
target_device: &Self::Device,
) -> Self::TensorHandle
fn change_backend_float( tensor: Self::TensorHandle, shape: Shape, target_device: &Self::Device, ) -> Self::TensorHandle
Change the backend of the given float tensor.
Sourcefn change_backend_int(
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
Change the backend of the given int tensor.
Sourcefn change_backend_bool(
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
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.