pub trait TensorState<D: VeScalar>: Debug {
// Required method
fn clone_tensor_as<TargetMapping: M>(
&self,
) -> Option<Tensor<D, TargetMapping>>;
}Expand description
Marker trait that tracks tensor presence at compile time.
The type parameter D ties the stored tensor’s scalar type to the pipeline’s current
scalar type, ensuring at compile time that tensor reads match the pipeline’s D.
Implementors either hold no data (NoTensor) or store a Tensor<D, Mapping> (HasTensor).
Required Methods§
Sourcefn clone_tensor_as<TargetMapping: M>(&self) -> Option<Tensor<D, TargetMapping>>
fn clone_tensor_as<TargetMapping: M>(&self) -> Option<Tensor<D, TargetMapping>>
Clones the tensor data, transposing to target mapping if needed.
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.