Skip to main content

FloatProtoElem

Trait FloatProtoElem 

Source
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§

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.

Implementations on Foreign Types§

Source§

impl FloatProtoElem for f32

Source§

impl FloatProtoElem for f64

Source§

impl FloatProtoElem for f16

Implementors§