pub trait BasicAutodiffOps<B: AutodiffBackend>: BasicOps<B> + BasicOps<B::InnerBackend> {
type InnerKind: BasicOps<B::InnerBackend>;
// Required methods
fn inner(
tensor: <Self as TensorKind<B>>::Primitive,
) -> <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive;
fn from_inner(
inner: <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive,
) -> <Self as TensorKind<B>>::Primitive;
}Expand description
Required Associated Types§
Sourcetype InnerKind: BasicOps<B::InnerBackend>
type InnerKind: BasicOps<B::InnerBackend>
Inner primitive tensor.
Required Methods§
Sourcefn inner(
tensor: <Self as TensorKind<B>>::Primitive,
) -> <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive
fn inner( tensor: <Self as TensorKind<B>>::Primitive, ) -> <Self::InnerKind as TensorKind<B::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.
Sourcefn from_inner(
inner: <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive,
) -> <Self as TensorKind<B>>::Primitive
fn from_inner( inner: <Self::InnerKind as TensorKind<B::InnerBackend>>::Primitive, ) -> <Self as TensorKind<B>>::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.
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.