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§
Sourcefn tensor_element_data_type() -> TensorElementDataType
fn tensor_element_data_type() -> TensorElementDataType
Return the ONNX type for a Rust type
Sourcefn try_utf8_bytes(&self) -> Option<&[u8]>
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.