Skip to main content

CastOps

Trait CastOps 

Source
pub trait CastOps<S: Clone + CastDtype, const MAX_RANK: usize>: TensorRef<S, MAX_RANK> {
    // Provided method
    fn try_cast_dtype<D: Clone + CastDtype>(
        &self,
    ) -> Result<Tensor<D, Global, MAX_RANK>, TensorError> { ... }
}
Expand description

Extension trait: type casting for any TensorRef implementor.

Provided Methods§

Source

fn try_cast_dtype<D: Clone + CastDtype>( &self, ) -> Result<Tensor<D, Global, MAX_RANK>, TensorError>

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.

Implementors§

Source§

impl<S: Clone + CastDtype, const R: usize, C: TensorRef<S, R>> CastOps<S, R> for C