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<const D: usize>( tensor: Self::Primitive<D>, ) -> <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive<D>; fn from_inner<const D: usize>( inner: <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive<D>, ) -> Self::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§

type InnerKind: BasicOps<<B as AutodiffBackend>::InnerBackend>

Inner primitive tensor.

Required Methods§

fn inner<const D: usize>( tensor: Self::Primitive<D>, ) -> <Self::InnerKind as TensorKind<<B as AutodiffBackend>::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.

fn from_inner<const D: usize>( inner: <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive<D>, ) -> Self::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.

Object Safety§

This trait is not object safe.

Implementors§