Trait burn::tensor::BasicAutodiffOps
pub trait BasicAutodiffOps<B>: BasicOps<B> + BasicOps<<B as AutodiffBackend>::InnerBackend>where
B: AutodiffBackend,{
type InnerKind: BasicOps<<B as AutodiffBackend>::InnerBackend>;
// Required methods
fn inner(
tensor: Self::Primitive,
) -> <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive;
fn from_inner(
inner: <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive,
) -> Self::Primitive;
}
Expand description
Trait that list all operations that can be applied on all tensors on an autodiff backend.
§Warnings
This is an internal trait, use the public API provided by tensor struct.
Required Associated Types§
type InnerKind: BasicOps<<B as AutodiffBackend>::InnerBackend>
type InnerKind: BasicOps<<B as AutodiffBackend>::InnerBackend>
Inner primitive tensor.
Required Methods§
fn inner(
tensor: Self::Primitive,
) -> <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive
fn inner( tensor: Self::Primitive, ) -> <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive
Returns the inner tensor without the autodiff information.
§Remarks
This is a low-level function used internally by the library to call different backend functions with static dispatch. It is not designed for direct usage by users, and not recommended to import or use this function directly.
Users should prefer the Tensor::inner function, which is more high-level and designed for public use.
fn from_inner(
inner: <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive,
) -> Self::Primitive
fn from_inner( inner: <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive, ) -> Self::Primitive
Convert a tensor to the autodiff backend.
§Remarks
This is a low-level function used internally by the library to call different backend functions with static dispatch. It is not designed for direct usage by users, and not recommended to import or use this function directly.
Users should prefer the Tensor::from_inner function, which is more high-level and designed for public use.