pub trait FloatProtoElem: Copy + 'static {
// Required methods
fn slice_into_tensor_dyn(
values: &[Self],
shape: &[usize],
) -> Result<TensorDyn>;
fn arrayview3_into_tensor_dyn(
view: ArrayView3<'_, Self>,
) -> Result<TensorDyn>;
}Expand description
Per-float-dtype construction of a [TensorDyn] from a flat slice / 3-D
ArrayView. Replaces the old IntoProtoTensor trait. Each implementor
either passes its element type straight to Tensor::from_slice /
Tensor::from_arrayview3, or narrows f64 to f32 (no native f64 kernel
path exists).
Required Methods§
fn slice_into_tensor_dyn(values: &[Self], shape: &[usize]) -> Result<TensorDyn>
fn arrayview3_into_tensor_dyn(view: ArrayView3<'_, Self>) -> Result<TensorDyn>
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.