Trait burn_tensor::BasicAutodiffOps
source · pub trait BasicAutodiffOps<B: AutodiffBackend>: BasicOps<B> + BasicOps<B::InnerBackend> {
type InnerKind: BasicOps<B::InnerBackend>;
// Required methods
fn inner<const D: usize>(
tensor: <Self as TensorKind<B>>::Primitive<D>,
) -> <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive<D>;
fn from_inner<const D: usize>(
inner: <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive<D>,
) -> <Self as TensorKind<B>>::Primitive<D>;
}
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§
sourcetype InnerKind: BasicOps<B::InnerBackend>
type InnerKind: BasicOps<B::InnerBackend>
Inner primitive tensor.
Required Methods§
sourcefn inner<const D: usize>(
tensor: <Self as TensorKind<B>>::Primitive<D>,
) -> <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive<D>
fn inner<const D: usize>( tensor: <Self as TensorKind<B>>::Primitive<D>, ) -> <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive<D>
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.
sourcefn from_inner<const D: usize>(
inner: <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive<D>,
) -> <Self as TensorKind<B>>::Primitive<D>
fn from_inner<const D: usize>( inner: <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive<D>, ) -> <Self as TensorKind<B>>::Primitive<D>
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.