pub struct TensorProto {Show 16 fields
pub dims: Vec<i64>,
pub data_type: i32,
pub segment: MessageField<Segment>,
pub float_data: Vec<f32>,
pub int32_data: Vec<i32>,
pub string_data: Vec<Bytes>,
pub int64_data: Vec<i64>,
pub name: String,
pub doc_string: String,
pub raw_data: Bytes,
pub external_data: Vec<StringStringEntryProto>,
pub data_location: EnumOrUnknown<DataLocation>,
pub double_data: Vec<f64>,
pub uint64_data: Vec<u64>,
pub metadata_props: Vec<StringStringEntryProto>,
pub special_fields: SpecialFields,
}Expand description
Generated protobuf bindings for the ONNX wire format messages that sibling crates need to decode on-disk artifacts.
Re-exported so callers (e.g. onnx-official-tests) can read .pb
reference tensors and inspect model.onnx input/output signatures
without rebuilding the bindings themselves.
TensorProtodecodes individual tensor.pbreference files.ModelProto/GraphProto/ValueInfoProto/TypeProto/TensorShapeProtoare used byonnx-official-tests’s build script to walk amodel.onnxheader and extract per-test input/output shape and dtype metadata so it can emit per-test harness glue with the correct rank and element type.
The inner namespaces (type_proto::Tensor, tensor_shape_proto:: Dimension, etc.) stay private. Callers can still reach them via
method calls on values of the re-exported outer types — Rust allows
public method calls on references to private types as long as the
private type is never named in user code.
Fields§
§dims: Vec<i64>§data_type: i32§segment: MessageField<Segment>§float_data: Vec<f32>§int32_data: Vec<i32>§string_data: Vec<Bytes>§int64_data: Vec<i64>§name: String§doc_string: String§raw_data: Bytes§external_data: Vec<StringStringEntryProto>§data_location: EnumOrUnknown<DataLocation>§double_data: Vec<f64>§uint64_data: Vec<u64>§metadata_props: Vec<StringStringEntryProto>§special_fields: SpecialFieldsImplementations§
Source§impl TensorProto
impl TensorProto
pub fn new() -> TensorProto
Trait Implementations§
Source§impl Clone for TensorProto
impl Clone for TensorProto
Source§fn clone(&self) -> TensorProto
fn clone(&self) -> TensorProto
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TensorProto
impl Debug for TensorProto
Source§impl<'a> Default for &'a TensorProto
impl<'a> Default for &'a TensorProto
Source§fn default() -> &'a TensorProto
fn default() -> &'a TensorProto
Source§impl Default for TensorProto
impl Default for TensorProto
Source§fn default() -> TensorProto
fn default() -> TensorProto
Source§impl Message for TensorProto
impl Message for TensorProto
Source§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
true for protobuf 3.Source§fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<()>
fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<()>
Source§fn compute_size(&self) -> u64
fn compute_size(&self) -> u64
Source§fn write_to_with_cached_sizes(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<()>
fn write_to_with_cached_sizes( &self, os: &mut CodedOutputStream<'_>, ) -> Result<()>
Source§fn special_fields(&self) -> &SpecialFields
fn special_fields(&self) -> &SpecialFields
Source§fn mut_special_fields(&mut self) -> &mut SpecialFields
fn mut_special_fields(&mut self) -> &mut SpecialFields
Source§fn new() -> TensorProto
fn new() -> TensorProto
Source§fn default_instance() -> &'static TensorProto
fn default_instance() -> &'static TensorProto
Source§fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self, Error>
fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self, Error>
Source§fn cached_size(&self) -> u32
fn cached_size(&self) -> u32
compute_size. Read moreSource§fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<(), Error>
fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<(), Error>
Source§fn write_length_delimited_to(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<(), Error>
fn write_length_delimited_to( &self, os: &mut CodedOutputStream<'_>, ) -> Result<(), Error>
Source§fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<(), Error>
fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<(), Error>
Source§fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
Source§fn parse_from_reader(reader: &mut dyn Read) -> Result<Self, Error>
fn parse_from_reader(reader: &mut dyn Read) -> Result<Self, Error>
Source§fn parse_from_tokio_bytes(bytes: &Bytes) -> Result<Self, Error>
fn parse_from_tokio_bytes(bytes: &Bytes) -> Result<Self, Error>
Bytes object.
Resulting message may share references to the passed bytes object.Source§fn check_initialized(&self) -> Result<(), Error>
fn check_initialized(&self) -> Result<(), Error>
Source§fn write_to_writer(&self, w: &mut dyn Write) -> Result<(), Error>
fn write_to_writer(&self, w: &mut dyn Write) -> Result<(), Error>
Source§fn write_length_delimited_to_writer(
&self,
w: &mut dyn Write,
) -> Result<(), Error>
fn write_length_delimited_to_writer( &self, w: &mut dyn Write, ) -> Result<(), Error>
Source§fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>, Error>
fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>, Error>
Source§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
Source§fn mut_unknown_fields(&mut self) -> &mut UnknownFields
fn mut_unknown_fields(&mut self) -> &mut UnknownFields
Source§impl PartialEq for TensorProto
impl PartialEq for TensorProto
Source§fn eq(&self, other: &TensorProto) -> bool
fn eq(&self, other: &TensorProto) -> bool
self and other values to be equal, and is used by ==.Source§impl TryFrom<TensorProto> for TensorData
Convert TensorProto to TensorData (convenience wrapper)
impl TryFrom<TensorProto> for TensorData
Convert TensorProto to TensorData (convenience wrapper)
This goes through TensorDataRef, which means the data is copied to ensure proper alignment for typed access.