Trait burn::tensor::backend::BackendBridge
pub trait BackendBridge<Origin>:
Send
+ Sync
+ Debugwhere
Origin: Backend,{
type Target: Backend;
// Required methods
fn into_target(
tensor: <Origin as Backend>::FloatTensorPrimitive,
device: Option<<Self::Target as Backend>::Device>,
) -> <Self::Target as Backend>::FloatTensorPrimitive;
fn from_target(
tensor: <Self::Target as Backend>::FloatTensorPrimitive,
device: Option<<Origin as Backend>::Device>,
) -> <Origin as Backend>::FloatTensorPrimitive;
}
Expand description
Allows tensors to be transferred between backends efficiently.
Required Associated Types§
Required Methods§
fn into_target(
tensor: <Origin as Backend>::FloatTensorPrimitive,
device: Option<<Self::Target as Backend>::Device>,
) -> <Self::Target as Backend>::FloatTensorPrimitive
fn into_target( tensor: <Origin as Backend>::FloatTensorPrimitive, device: Option<<Self::Target as Backend>::Device>, ) -> <Self::Target as Backend>::FloatTensorPrimitive
Transfer the tensor to the target backend.
fn from_target(
tensor: <Self::Target as Backend>::FloatTensorPrimitive,
device: Option<<Origin as Backend>::Device>,
) -> <Origin as Backend>::FloatTensorPrimitive
fn from_target( tensor: <Self::Target as Backend>::FloatTensorPrimitive, device: Option<<Origin as Backend>::Device>, ) -> <Origin as Backend>::FloatTensorPrimitive
Transfer the tensor from the target backend.
Object Safety§
This trait is not object safe.