#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_imports)]
#![allow(unused_results)]
#[derive(PartialEq,Clone,Default)]
pub struct TensorProto {
pub dtype: super::types::DataType,
pub tensor_shape: ::protobuf::SingularPtrField<super::tensor_shape::TensorShapeProto>,
pub version_number: i32,
pub tensor_content: ::std::vec::Vec<u8>,
pub half_val: ::std::vec::Vec<i32>,
pub float_val: ::std::vec::Vec<f32>,
pub double_val: ::std::vec::Vec<f64>,
pub int_val: ::std::vec::Vec<i32>,
pub string_val: ::protobuf::RepeatedField<::std::vec::Vec<u8>>,
pub scomplex_val: ::std::vec::Vec<f32>,
pub int64_val: ::std::vec::Vec<i64>,
pub bool_val: ::std::vec::Vec<bool>,
pub dcomplex_val: ::std::vec::Vec<f64>,
pub resource_handle_val: ::protobuf::RepeatedField<super::resource_handle::ResourceHandleProto>,
pub variant_val: ::protobuf::RepeatedField<VariantTensorDataProto>,
pub uint32_val: ::std::vec::Vec<u32>,
pub uint64_val: ::std::vec::Vec<u64>,
pub float8_val: ::std::vec::Vec<u8>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a TensorProto {
fn default() -> &'a TensorProto {
<TensorProto as ::protobuf::Message>::default_instance()
}
}
impl TensorProto {
pub fn new() -> TensorProto {
::std::default::Default::default()
}
pub fn get_dtype(&self) -> super::types::DataType {
self.dtype
}
pub fn clear_dtype(&mut self) {
self.dtype = super::types::DataType::DT_INVALID;
}
pub fn set_dtype(&mut self, v: super::types::DataType) {
self.dtype = v;
}
pub fn get_tensor_shape(&self) -> &super::tensor_shape::TensorShapeProto {
self.tensor_shape.as_ref().unwrap_or_else(|| <super::tensor_shape::TensorShapeProto as ::protobuf::Message>::default_instance())
}
pub fn clear_tensor_shape(&mut self) {
self.tensor_shape.clear();
}
pub fn has_tensor_shape(&self) -> bool {
self.tensor_shape.is_some()
}
pub fn set_tensor_shape(&mut self, v: super::tensor_shape::TensorShapeProto) {
self.tensor_shape = ::protobuf::SingularPtrField::some(v);
}
pub fn mut_tensor_shape(&mut self) -> &mut super::tensor_shape::TensorShapeProto {
if self.tensor_shape.is_none() {
self.tensor_shape.set_default();
}
self.tensor_shape.as_mut().unwrap()
}
pub fn take_tensor_shape(&mut self) -> super::tensor_shape::TensorShapeProto {
self.tensor_shape.take().unwrap_or_else(|| super::tensor_shape::TensorShapeProto::new())
}
pub fn get_version_number(&self) -> i32 {
self.version_number
}
pub fn clear_version_number(&mut self) {
self.version_number = 0;
}
pub fn set_version_number(&mut self, v: i32) {
self.version_number = v;
}
pub fn get_tensor_content(&self) -> &[u8] {
&self.tensor_content
}
pub fn clear_tensor_content(&mut self) {
self.tensor_content.clear();
}
pub fn set_tensor_content(&mut self, v: ::std::vec::Vec<u8>) {
self.tensor_content = v;
}
pub fn mut_tensor_content(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.tensor_content
}
pub fn take_tensor_content(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.tensor_content, ::std::vec::Vec::new())
}
pub fn get_half_val(&self) -> &[i32] {
&self.half_val
}
pub fn clear_half_val(&mut self) {
self.half_val.clear();
}
pub fn set_half_val(&mut self, v: ::std::vec::Vec<i32>) {
self.half_val = v;
}
pub fn mut_half_val(&mut self) -> &mut ::std::vec::Vec<i32> {
&mut self.half_val
}
pub fn take_half_val(&mut self) -> ::std::vec::Vec<i32> {
::std::mem::replace(&mut self.half_val, ::std::vec::Vec::new())
}
pub fn get_float_val(&self) -> &[f32] {
&self.float_val
}
pub fn clear_float_val(&mut self) {
self.float_val.clear();
}
pub fn set_float_val(&mut self, v: ::std::vec::Vec<f32>) {
self.float_val = v;
}
pub fn mut_float_val(&mut self) -> &mut ::std::vec::Vec<f32> {
&mut self.float_val
}
pub fn take_float_val(&mut self) -> ::std::vec::Vec<f32> {
::std::mem::replace(&mut self.float_val, ::std::vec::Vec::new())
}
pub fn get_double_val(&self) -> &[f64] {
&self.double_val
}
pub fn clear_double_val(&mut self) {
self.double_val.clear();
}
pub fn set_double_val(&mut self, v: ::std::vec::Vec<f64>) {
self.double_val = v;
}
pub fn mut_double_val(&mut self) -> &mut ::std::vec::Vec<f64> {
&mut self.double_val
}
pub fn take_double_val(&mut self) -> ::std::vec::Vec<f64> {
::std::mem::replace(&mut self.double_val, ::std::vec::Vec::new())
}
pub fn get_int_val(&self) -> &[i32] {
&self.int_val
}
pub fn clear_int_val(&mut self) {
self.int_val.clear();
}
pub fn set_int_val(&mut self, v: ::std::vec::Vec<i32>) {
self.int_val = v;
}
pub fn mut_int_val(&mut self) -> &mut ::std::vec::Vec<i32> {
&mut self.int_val
}
pub fn take_int_val(&mut self) -> ::std::vec::Vec<i32> {
::std::mem::replace(&mut self.int_val, ::std::vec::Vec::new())
}
pub fn get_string_val(&self) -> &[::std::vec::Vec<u8>] {
&self.string_val
}
pub fn clear_string_val(&mut self) {
self.string_val.clear();
}
pub fn set_string_val(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec<u8>>) {
self.string_val = v;
}
pub fn mut_string_val(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec<u8>> {
&mut self.string_val
}
pub fn take_string_val(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec<u8>> {
::std::mem::replace(&mut self.string_val, ::protobuf::RepeatedField::new())
}
pub fn get_scomplex_val(&self) -> &[f32] {
&self.scomplex_val
}
pub fn clear_scomplex_val(&mut self) {
self.scomplex_val.clear();
}
pub fn set_scomplex_val(&mut self, v: ::std::vec::Vec<f32>) {
self.scomplex_val = v;
}
pub fn mut_scomplex_val(&mut self) -> &mut ::std::vec::Vec<f32> {
&mut self.scomplex_val
}
pub fn take_scomplex_val(&mut self) -> ::std::vec::Vec<f32> {
::std::mem::replace(&mut self.scomplex_val, ::std::vec::Vec::new())
}
pub fn get_int64_val(&self) -> &[i64] {
&self.int64_val
}
pub fn clear_int64_val(&mut self) {
self.int64_val.clear();
}
pub fn set_int64_val(&mut self, v: ::std::vec::Vec<i64>) {
self.int64_val = v;
}
pub fn mut_int64_val(&mut self) -> &mut ::std::vec::Vec<i64> {
&mut self.int64_val
}
pub fn take_int64_val(&mut self) -> ::std::vec::Vec<i64> {
::std::mem::replace(&mut self.int64_val, ::std::vec::Vec::new())
}
pub fn get_bool_val(&self) -> &[bool] {
&self.bool_val
}
pub fn clear_bool_val(&mut self) {
self.bool_val.clear();
}
pub fn set_bool_val(&mut self, v: ::std::vec::Vec<bool>) {
self.bool_val = v;
}
pub fn mut_bool_val(&mut self) -> &mut ::std::vec::Vec<bool> {
&mut self.bool_val
}
pub fn take_bool_val(&mut self) -> ::std::vec::Vec<bool> {
::std::mem::replace(&mut self.bool_val, ::std::vec::Vec::new())
}
pub fn get_dcomplex_val(&self) -> &[f64] {
&self.dcomplex_val
}
pub fn clear_dcomplex_val(&mut self) {
self.dcomplex_val.clear();
}
pub fn set_dcomplex_val(&mut self, v: ::std::vec::Vec<f64>) {
self.dcomplex_val = v;
}
pub fn mut_dcomplex_val(&mut self) -> &mut ::std::vec::Vec<f64> {
&mut self.dcomplex_val
}
pub fn take_dcomplex_val(&mut self) -> ::std::vec::Vec<f64> {
::std::mem::replace(&mut self.dcomplex_val, ::std::vec::Vec::new())
}
pub fn get_resource_handle_val(&self) -> &[super::resource_handle::ResourceHandleProto] {
&self.resource_handle_val
}
pub fn clear_resource_handle_val(&mut self) {
self.resource_handle_val.clear();
}
pub fn set_resource_handle_val(&mut self, v: ::protobuf::RepeatedField<super::resource_handle::ResourceHandleProto>) {
self.resource_handle_val = v;
}
pub fn mut_resource_handle_val(&mut self) -> &mut ::protobuf::RepeatedField<super::resource_handle::ResourceHandleProto> {
&mut self.resource_handle_val
}
pub fn take_resource_handle_val(&mut self) -> ::protobuf::RepeatedField<super::resource_handle::ResourceHandleProto> {
::std::mem::replace(&mut self.resource_handle_val, ::protobuf::RepeatedField::new())
}
pub fn get_variant_val(&self) -> &[VariantTensorDataProto] {
&self.variant_val
}
pub fn clear_variant_val(&mut self) {
self.variant_val.clear();
}
pub fn set_variant_val(&mut self, v: ::protobuf::RepeatedField<VariantTensorDataProto>) {
self.variant_val = v;
}
pub fn mut_variant_val(&mut self) -> &mut ::protobuf::RepeatedField<VariantTensorDataProto> {
&mut self.variant_val
}
pub fn take_variant_val(&mut self) -> ::protobuf::RepeatedField<VariantTensorDataProto> {
::std::mem::replace(&mut self.variant_val, ::protobuf::RepeatedField::new())
}
pub fn get_uint32_val(&self) -> &[u32] {
&self.uint32_val
}
pub fn clear_uint32_val(&mut self) {
self.uint32_val.clear();
}
pub fn set_uint32_val(&mut self, v: ::std::vec::Vec<u32>) {
self.uint32_val = v;
}
pub fn mut_uint32_val(&mut self) -> &mut ::std::vec::Vec<u32> {
&mut self.uint32_val
}
pub fn take_uint32_val(&mut self) -> ::std::vec::Vec<u32> {
::std::mem::replace(&mut self.uint32_val, ::std::vec::Vec::new())
}
pub fn get_uint64_val(&self) -> &[u64] {
&self.uint64_val
}
pub fn clear_uint64_val(&mut self) {
self.uint64_val.clear();
}
pub fn set_uint64_val(&mut self, v: ::std::vec::Vec<u64>) {
self.uint64_val = v;
}
pub fn mut_uint64_val(&mut self) -> &mut ::std::vec::Vec<u64> {
&mut self.uint64_val
}
pub fn take_uint64_val(&mut self) -> ::std::vec::Vec<u64> {
::std::mem::replace(&mut self.uint64_val, ::std::vec::Vec::new())
}
pub fn get_float8_val(&self) -> &[u8] {
&self.float8_val
}
pub fn clear_float8_val(&mut self) {
self.float8_val.clear();
}
pub fn set_float8_val(&mut self, v: ::std::vec::Vec<u8>) {
self.float8_val = v;
}
pub fn mut_float8_val(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.float8_val
}
pub fn take_float8_val(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.float8_val, ::std::vec::Vec::new())
}
}
impl ::protobuf::Message for TensorProto {
fn is_initialized(&self) -> bool {
for v in &self.tensor_shape {
if !v.is_initialized() {
return false;
}
};
for v in &self.resource_handle_val {
if !v.is_initialized() {
return false;
}
};
for v in &self.variant_val {
if !v.is_initialized() {
return false;
}
};
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.dtype, 1, &mut self.unknown_fields)?
},
2 => {
::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.tensor_shape)?;
},
3 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_int32()?;
self.version_number = tmp;
},
4 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.tensor_content)?;
},
13 => {
::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.half_val)?;
},
5 => {
::protobuf::rt::read_repeated_float_into(wire_type, is, &mut self.float_val)?;
},
6 => {
::protobuf::rt::read_repeated_double_into(wire_type, is, &mut self.double_val)?;
},
7 => {
::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.int_val)?;
},
8 => {
::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.string_val)?;
},
9 => {
::protobuf::rt::read_repeated_float_into(wire_type, is, &mut self.scomplex_val)?;
},
10 => {
::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.int64_val)?;
},
11 => {
::protobuf::rt::read_repeated_bool_into(wire_type, is, &mut self.bool_val)?;
},
12 => {
::protobuf::rt::read_repeated_double_into(wire_type, is, &mut self.dcomplex_val)?;
},
14 => {
::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.resource_handle_val)?;
},
15 => {
::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.variant_val)?;
},
16 => {
::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.uint32_val)?;
},
17 => {
::protobuf::rt::read_repeated_uint64_into(wire_type, is, &mut self.uint64_val)?;
},
18 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.float8_val)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if self.dtype != super::types::DataType::DT_INVALID {
my_size += ::protobuf::rt::enum_size(1, self.dtype);
}
if let Some(ref v) = self.tensor_shape.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
}
if self.version_number != 0 {
my_size += ::protobuf::rt::value_size(3, self.version_number, ::protobuf::wire_format::WireTypeVarint);
}
if !self.tensor_content.is_empty() {
my_size += ::protobuf::rt::bytes_size(4, &self.tensor_content);
}
if !self.half_val.is_empty() {
my_size += ::protobuf::rt::vec_packed_varint_size(13, &self.half_val);
}
if !self.float_val.is_empty() {
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.float_val.len() * 4) as u32) + (self.float_val.len() * 4) as u32;
}
if !self.double_val.is_empty() {
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.double_val.len() * 8) as u32) + (self.double_val.len() * 8) as u32;
}
if !self.int_val.is_empty() {
my_size += ::protobuf::rt::vec_packed_varint_size(7, &self.int_val);
}
for value in &self.string_val {
my_size += ::protobuf::rt::bytes_size(8, &value);
};
if !self.scomplex_val.is_empty() {
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.scomplex_val.len() * 4) as u32) + (self.scomplex_val.len() * 4) as u32;
}
if !self.int64_val.is_empty() {
my_size += ::protobuf::rt::vec_packed_varint_size(10, &self.int64_val);
}
if !self.bool_val.is_empty() {
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.bool_val.len() * 1) as u32) + (self.bool_val.len() * 1) as u32;
}
if !self.dcomplex_val.is_empty() {
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.dcomplex_val.len() * 8) as u32) + (self.dcomplex_val.len() * 8) as u32;
}
for value in &self.resource_handle_val {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
};
for value in &self.variant_val {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
};
if !self.uint32_val.is_empty() {
my_size += ::protobuf::rt::vec_packed_varint_size(16, &self.uint32_val);
}
if !self.uint64_val.is_empty() {
my_size += ::protobuf::rt::vec_packed_varint_size(17, &self.uint64_val);
}
if !self.float8_val.is_empty() {
my_size += ::protobuf::rt::bytes_size(18, &self.float8_val);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if self.dtype != super::types::DataType::DT_INVALID {
os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.dtype))?;
}
if let Some(ref v) = self.tensor_shape.as_ref() {
os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
}
if self.version_number != 0 {
os.write_int32(3, self.version_number)?;
}
if !self.tensor_content.is_empty() {
os.write_bytes(4, &self.tensor_content)?;
}
if !self.half_val.is_empty() {
os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.half_val))?;
for v in &self.half_val {
os.write_int32_no_tag(*v)?;
};
}
if !self.float_val.is_empty() {
os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32((self.float_val.len() * 4) as u32)?;
for v in &self.float_val {
os.write_float_no_tag(*v)?;
};
}
if !self.double_val.is_empty() {
os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32((self.double_val.len() * 8) as u32)?;
for v in &self.double_val {
os.write_double_no_tag(*v)?;
};
}
if !self.int_val.is_empty() {
os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.int_val))?;
for v in &self.int_val {
os.write_int32_no_tag(*v)?;
};
}
for v in &self.string_val {
os.write_bytes(8, &v)?;
};
if !self.scomplex_val.is_empty() {
os.write_tag(9, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32((self.scomplex_val.len() * 4) as u32)?;
for v in &self.scomplex_val {
os.write_float_no_tag(*v)?;
};
}
if !self.int64_val.is_empty() {
os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.int64_val))?;
for v in &self.int64_val {
os.write_int64_no_tag(*v)?;
};
}
if !self.bool_val.is_empty() {
os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32((self.bool_val.len() * 1) as u32)?;
for v in &self.bool_val {
os.write_bool_no_tag(*v)?;
};
}
if !self.dcomplex_val.is_empty() {
os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32((self.dcomplex_val.len() * 8) as u32)?;
for v in &self.dcomplex_val {
os.write_double_no_tag(*v)?;
};
}
for v in &self.resource_handle_val {
os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
};
for v in &self.variant_val {
os.write_tag(15, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
};
if !self.uint32_val.is_empty() {
os.write_tag(16, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.uint32_val))?;
for v in &self.uint32_val {
os.write_uint32_no_tag(*v)?;
};
}
if !self.uint64_val.is_empty() {
os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.uint64_val))?;
for v in &self.uint64_val {
os.write_uint64_no_tag(*v)?;
};
}
if !self.float8_val.is_empty() {
os.write_bytes(18, &self.float8_val)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> TensorProto {
TensorProto::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<super::types::DataType>>(
"dtype",
|m: &TensorProto| { &m.dtype },
|m: &mut TensorProto| { &mut m.dtype },
));
fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::tensor_shape::TensorShapeProto>>(
"tensor_shape",
|m: &TensorProto| { &m.tensor_shape },
|m: &mut TensorProto| { &mut m.tensor_shape },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
"version_number",
|m: &TensorProto| { &m.version_number },
|m: &mut TensorProto| { &mut m.version_number },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"tensor_content",
|m: &TensorProto| { &m.tensor_content },
|m: &mut TensorProto| { &mut m.tensor_content },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
"half_val",
|m: &TensorProto| { &m.half_val },
|m: &mut TensorProto| { &mut m.half_val },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeFloat>(
"float_val",
|m: &TensorProto| { &m.float_val },
|m: &mut TensorProto| { &mut m.float_val },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
"double_val",
|m: &TensorProto| { &m.double_val },
|m: &mut TensorProto| { &mut m.double_val },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
"int_val",
|m: &TensorProto| { &m.int_val },
|m: &mut TensorProto| { &mut m.int_val },
));
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"string_val",
|m: &TensorProto| { &m.string_val },
|m: &mut TensorProto| { &mut m.string_val },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeFloat>(
"scomplex_val",
|m: &TensorProto| { &m.scomplex_val },
|m: &mut TensorProto| { &mut m.scomplex_val },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
"int64_val",
|m: &TensorProto| { &m.int64_val },
|m: &mut TensorProto| { &mut m.int64_val },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"bool_val",
|m: &TensorProto| { &m.bool_val },
|m: &mut TensorProto| { &mut m.bool_val },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
"dcomplex_val",
|m: &TensorProto| { &m.dcomplex_val },
|m: &mut TensorProto| { &mut m.dcomplex_val },
));
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::resource_handle::ResourceHandleProto>>(
"resource_handle_val",
|m: &TensorProto| { &m.resource_handle_val },
|m: &mut TensorProto| { &mut m.resource_handle_val },
));
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<VariantTensorDataProto>>(
"variant_val",
|m: &TensorProto| { &m.variant_val },
|m: &mut TensorProto| { &mut m.variant_val },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"uint32_val",
|m: &TensorProto| { &m.uint32_val },
|m: &mut TensorProto| { &mut m.uint32_val },
));
fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"uint64_val",
|m: &TensorProto| { &m.uint64_val },
|m: &mut TensorProto| { &mut m.uint64_val },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"float8_val",
|m: &TensorProto| { &m.float8_val },
|m: &mut TensorProto| { &mut m.float8_val },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<TensorProto>(
"TensorProto",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static TensorProto {
static instance: ::protobuf::rt::LazyV2<TensorProto> = ::protobuf::rt::LazyV2::INIT;
instance.get(TensorProto::new)
}
}
impl ::protobuf::Clear for TensorProto {
fn clear(&mut self) {
self.dtype = super::types::DataType::DT_INVALID;
self.tensor_shape.clear();
self.version_number = 0;
self.tensor_content.clear();
self.half_val.clear();
self.float_val.clear();
self.double_val.clear();
self.int_val.clear();
self.string_val.clear();
self.scomplex_val.clear();
self.int64_val.clear();
self.bool_val.clear();
self.dcomplex_val.clear();
self.resource_handle_val.clear();
self.variant_val.clear();
self.uint32_val.clear();
self.uint64_val.clear();
self.float8_val.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for TensorProto {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for TensorProto {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct VariantTensorDataProto {
pub type_name: ::std::string::String,
pub metadata: ::std::vec::Vec<u8>,
pub tensors: ::protobuf::RepeatedField<TensorProto>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a VariantTensorDataProto {
fn default() -> &'a VariantTensorDataProto {
<VariantTensorDataProto as ::protobuf::Message>::default_instance()
}
}
impl VariantTensorDataProto {
pub fn new() -> VariantTensorDataProto {
::std::default::Default::default()
}
pub fn get_type_name(&self) -> &str {
&self.type_name
}
pub fn clear_type_name(&mut self) {
self.type_name.clear();
}
pub fn set_type_name(&mut self, v: ::std::string::String) {
self.type_name = v;
}
pub fn mut_type_name(&mut self) -> &mut ::std::string::String {
&mut self.type_name
}
pub fn take_type_name(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.type_name, ::std::string::String::new())
}
pub fn get_metadata(&self) -> &[u8] {
&self.metadata
}
pub fn clear_metadata(&mut self) {
self.metadata.clear();
}
pub fn set_metadata(&mut self, v: ::std::vec::Vec<u8>) {
self.metadata = v;
}
pub fn mut_metadata(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.metadata
}
pub fn take_metadata(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.metadata, ::std::vec::Vec::new())
}
pub fn get_tensors(&self) -> &[TensorProto] {
&self.tensors
}
pub fn clear_tensors(&mut self) {
self.tensors.clear();
}
pub fn set_tensors(&mut self, v: ::protobuf::RepeatedField<TensorProto>) {
self.tensors = v;
}
pub fn mut_tensors(&mut self) -> &mut ::protobuf::RepeatedField<TensorProto> {
&mut self.tensors
}
pub fn take_tensors(&mut self) -> ::protobuf::RepeatedField<TensorProto> {
::std::mem::replace(&mut self.tensors, ::protobuf::RepeatedField::new())
}
}
impl ::protobuf::Message for VariantTensorDataProto {
fn is_initialized(&self) -> bool {
for v in &self.tensors {
if !v.is_initialized() {
return false;
}
};
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.type_name)?;
},
2 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.metadata)?;
},
3 => {
::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.tensors)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if !self.type_name.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.type_name);
}
if !self.metadata.is_empty() {
my_size += ::protobuf::rt::bytes_size(2, &self.metadata);
}
for value in &self.tensors {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
};
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if !self.type_name.is_empty() {
os.write_string(1, &self.type_name)?;
}
if !self.metadata.is_empty() {
os.write_bytes(2, &self.metadata)?;
}
for v in &self.tensors {
os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
};
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> VariantTensorDataProto {
VariantTensorDataProto::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"type_name",
|m: &VariantTensorDataProto| { &m.type_name },
|m: &mut VariantTensorDataProto| { &mut m.type_name },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"metadata",
|m: &VariantTensorDataProto| { &m.metadata },
|m: &mut VariantTensorDataProto| { &mut m.metadata },
));
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<TensorProto>>(
"tensors",
|m: &VariantTensorDataProto| { &m.tensors },
|m: &mut VariantTensorDataProto| { &mut m.tensors },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<VariantTensorDataProto>(
"VariantTensorDataProto",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static VariantTensorDataProto {
static instance: ::protobuf::rt::LazyV2<VariantTensorDataProto> = ::protobuf::rt::LazyV2::INIT;
instance.get(VariantTensorDataProto::new)
}
}
impl ::protobuf::Clear for VariantTensorDataProto {
fn clear(&mut self) {
self.type_name.clear();
self.metadata.clear();
self.tensors.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for VariantTensorDataProto {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for VariantTensorDataProto {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n&tensorflow/core/framework/tensor.proto\x12\ntensorflow\x1a/tensorflow\
/core/framework/resource_handle.proto\x1a,tensorflow/core/framework/tens\
or_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xf0\x05\n\x0b\
TensorProto\x12*\n\x05dtype\x18\x01\x20\x01(\x0e2\x14.tensorflow.DataTyp\
eR\x05dtype\x12?\n\x0ctensor_shape\x18\x02\x20\x01(\x0b2\x1c.tensorflow.\
TensorShapeProtoR\x0btensorShape\x12%\n\x0eversion_number\x18\x03\x20\
\x01(\x05R\rversionNumber\x12%\n\x0etensor_content\x18\x04\x20\x01(\x0cR\
\rtensorContent\x12\x1d\n\x08half_val\x18\r\x20\x03(\x05R\x07halfValB\
\x02\x10\x01\x12\x1f\n\tfloat_val\x18\x05\x20\x03(\x02R\x08floatValB\x02\
\x10\x01\x12!\n\ndouble_val\x18\x06\x20\x03(\x01R\tdoubleValB\x02\x10\
\x01\x12\x1b\n\x07int_val\x18\x07\x20\x03(\x05R\x06intValB\x02\x10\x01\
\x12\x1d\n\nstring_val\x18\x08\x20\x03(\x0cR\tstringVal\x12%\n\x0cscompl\
ex_val\x18\t\x20\x03(\x02R\x0bscomplexValB\x02\x10\x01\x12\x1f\n\tint64_\
val\x18\n\x20\x03(\x03R\x08int64ValB\x02\x10\x01\x12\x1d\n\x08bool_val\
\x18\x0b\x20\x03(\x08R\x07boolValB\x02\x10\x01\x12%\n\x0cdcomplex_val\
\x18\x0c\x20\x03(\x01R\x0bdcomplexValB\x02\x10\x01\x12O\n\x13resource_ha\
ndle_val\x18\x0e\x20\x03(\x0b2\x1f.tensorflow.ResourceHandleProtoR\x11re\
sourceHandleVal\x12C\n\x0bvariant_val\x18\x0f\x20\x03(\x0b2\".tensorflow\
.VariantTensorDataProtoR\nvariantVal\x12!\n\nuint32_val\x18\x10\x20\x03(\
\rR\tuint32ValB\x02\x10\x01\x12!\n\nuint64_val\x18\x11\x20\x03(\x04R\tui\
nt64ValB\x02\x10\x01\x12\x1d\n\nfloat8_val\x18\x12\x20\x01(\x0cR\tfloat8\
Val\"\x84\x01\n\x16VariantTensorDataProto\x12\x1b\n\ttype_name\x18\x01\
\x20\x01(\tR\x08typeName\x12\x1a\n\x08metadata\x18\x02\x20\x01(\x0cR\x08\
metadata\x121\n\x07tensors\x18\x03\x20\x03(\x0b2\x17.tensorflow.TensorPr\
otoR\x07tensorsB|\n\x18org.tensorflow.frameworkB\x0cTensorProtosP\x01ZMg\
ithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_go_p\
roto\xf8\x01\x01b\x06proto3\
";
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
}
pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
file_descriptor_proto_lazy.get(|| {
parse_descriptor_proto()
})
}