Trait TypeToTensorElementDataType

Source
pub trait TypeToTensorElementDataType {
    // Required methods
    fn tensor_element_data_type() -> TensorElementDataType;
    fn try_utf8_bytes(&self) -> Option<&[u8]>;
}
Expand description

Trait used to map Rust types (for example f32) to ONNX types (for example Float)

Required Methods§

Source

fn tensor_element_data_type() -> TensorElementDataType

Return the ONNX type for a Rust type

Source

fn try_utf8_bytes(&self) -> Option<&[u8]>

If the type is String, returns Some with utf8 contents, else None.

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 TypeToTensorElementDataType for f32

Source§

impl TypeToTensorElementDataType for f64

Source§

impl TypeToTensorElementDataType for i8

Source§

impl TypeToTensorElementDataType for i16

Source§

impl TypeToTensorElementDataType for i32

Source§

impl TypeToTensorElementDataType for i64

Source§

impl TypeToTensorElementDataType for u8

Source§

impl TypeToTensorElementDataType for u16

Source§

impl TypeToTensorElementDataType for u32

Source§

impl TypeToTensorElementDataType for u64

Implementors§