tensorflow_serving_client/
tensor_shape.rs1#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![cfg_attr(rustfmt, rustfmt_skip)]
9
10#![allow(box_pointers)]
11#![allow(dead_code)]
12#![allow(missing_docs)]
13#![allow(non_camel_case_types)]
14#![allow(non_snake_case)]
15#![allow(non_upper_case_globals)]
16#![allow(trivial_casts)]
17#![allow(unsafe_code)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20use protobuf::Message as Message_imported_for_functions;
23use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
24
25#[derive(PartialEq,Clone,Default)]
30pub struct TensorShapeProto {
31 pub dim: ::protobuf::RepeatedField<TensorShapeProto_Dim>,
33 pub unknown_rank: bool,
34 pub unknown_fields: ::protobuf::UnknownFields,
36 pub cached_size: ::protobuf::CachedSize,
37}
38
39impl<'a> ::std::default::Default for &'a TensorShapeProto {
40 fn default() -> &'a TensorShapeProto {
41 <TensorShapeProto as ::protobuf::Message>::default_instance()
42 }
43}
44
45impl TensorShapeProto {
46 pub fn new() -> TensorShapeProto {
47 ::std::default::Default::default()
48 }
49
50 pub fn get_dim(&self) -> &[TensorShapeProto_Dim] {
54 &self.dim
55 }
56 pub fn clear_dim(&mut self) {
57 self.dim.clear();
58 }
59
60 pub fn set_dim(&mut self, v: ::protobuf::RepeatedField<TensorShapeProto_Dim>) {
62 self.dim = v;
63 }
64
65 pub fn mut_dim(&mut self) -> &mut ::protobuf::RepeatedField<TensorShapeProto_Dim> {
67 &mut self.dim
68 }
69
70 pub fn take_dim(&mut self) -> ::protobuf::RepeatedField<TensorShapeProto_Dim> {
72 ::std::mem::replace(&mut self.dim, ::protobuf::RepeatedField::new())
73 }
74
75 pub fn get_unknown_rank(&self) -> bool {
79 self.unknown_rank
80 }
81 pub fn clear_unknown_rank(&mut self) {
82 self.unknown_rank = false;
83 }
84
85 pub fn set_unknown_rank(&mut self, v: bool) {
87 self.unknown_rank = v;
88 }
89}
90
91impl ::protobuf::Message for TensorShapeProto {
92 fn is_initialized(&self) -> bool {
93 for v in &self.dim {
94 if !v.is_initialized() {
95 return false;
96 }
97 };
98 true
99 }
100
101 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
102 while !is.eof()? {
103 let (field_number, wire_type) = is.read_tag_unpack()?;
104 match field_number {
105 2 => {
106 ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.dim)?;
107 },
108 3 => {
109 if wire_type != ::protobuf::wire_format::WireTypeVarint {
110 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
111 }
112 let tmp = is.read_bool()?;
113 self.unknown_rank = tmp;
114 },
115 _ => {
116 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
117 },
118 };
119 }
120 ::std::result::Result::Ok(())
121 }
122
123 #[allow(unused_variables)]
125 fn compute_size(&self) -> u32 {
126 let mut my_size = 0;
127 for value in &self.dim {
128 let len = value.compute_size();
129 my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
130 };
131 if self.unknown_rank != false {
132 my_size += 2;
133 }
134 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
135 self.cached_size.set(my_size);
136 my_size
137 }
138
139 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
140 for v in &self.dim {
141 os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
142 os.write_raw_varint32(v.get_cached_size())?;
143 v.write_to_with_cached_sizes(os)?;
144 };
145 if self.unknown_rank != false {
146 os.write_bool(3, self.unknown_rank)?;
147 }
148 os.write_unknown_fields(self.get_unknown_fields())?;
149 ::std::result::Result::Ok(())
150 }
151
152 fn get_cached_size(&self) -> u32 {
153 self.cached_size.get()
154 }
155
156 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
157 &self.unknown_fields
158 }
159
160 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
161 &mut self.unknown_fields
162 }
163
164 fn as_any(&self) -> &dyn (::std::any::Any) {
165 self as &dyn (::std::any::Any)
166 }
167 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
168 self as &mut dyn (::std::any::Any)
169 }
170 fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
171 self
172 }
173
174 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
175 Self::descriptor_static()
176 }
177
178 fn new() -> TensorShapeProto {
179 TensorShapeProto::new()
180 }
181
182 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
183 static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
184 unsafe {
185 descriptor.get(|| {
186 let mut fields = ::std::vec::Vec::new();
187 fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<TensorShapeProto_Dim>>(
188 "dim",
189 |m: &TensorShapeProto| { &m.dim },
190 |m: &mut TensorShapeProto| { &mut m.dim },
191 ));
192 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
193 "unknown_rank",
194 |m: &TensorShapeProto| { &m.unknown_rank },
195 |m: &mut TensorShapeProto| { &mut m.unknown_rank },
196 ));
197 ::protobuf::reflect::MessageDescriptor::new_pb_name::<TensorShapeProto>(
198 "TensorShapeProto",
199 fields,
200 file_descriptor_proto()
201 )
202 })
203 }
204 }
205
206 fn default_instance() -> &'static TensorShapeProto {
207 static mut instance: ::protobuf::lazy::Lazy<TensorShapeProto> = ::protobuf::lazy::Lazy::INIT;
208 unsafe {
209 instance.get(TensorShapeProto::new)
210 }
211 }
212}
213
214impl ::protobuf::Clear for TensorShapeProto {
215 fn clear(&mut self) {
216 self.dim.clear();
217 self.unknown_rank = false;
218 self.unknown_fields.clear();
219 }
220}
221
222impl ::std::fmt::Debug for TensorShapeProto {
223 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
224 ::protobuf::text_format::fmt(self, f)
225 }
226}
227
228impl ::protobuf::reflect::ProtobufValue for TensorShapeProto {
229 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
230 ::protobuf::reflect::ReflectValueRef::Message(self)
231 }
232}
233
234#[derive(PartialEq,Clone,Default)]
235pub struct TensorShapeProto_Dim {
236 pub size: i64,
238 pub name: ::std::string::String,
239 pub unknown_fields: ::protobuf::UnknownFields,
241 pub cached_size: ::protobuf::CachedSize,
242}
243
244impl<'a> ::std::default::Default for &'a TensorShapeProto_Dim {
245 fn default() -> &'a TensorShapeProto_Dim {
246 <TensorShapeProto_Dim as ::protobuf::Message>::default_instance()
247 }
248}
249
250impl TensorShapeProto_Dim {
251 pub fn new() -> TensorShapeProto_Dim {
252 ::std::default::Default::default()
253 }
254
255 pub fn get_size(&self) -> i64 {
259 self.size
260 }
261 pub fn clear_size(&mut self) {
262 self.size = 0;
263 }
264
265 pub fn set_size(&mut self, v: i64) {
267 self.size = v;
268 }
269
270 pub fn get_name(&self) -> &str {
274 &self.name
275 }
276 pub fn clear_name(&mut self) {
277 self.name.clear();
278 }
279
280 pub fn set_name(&mut self, v: ::std::string::String) {
282 self.name = v;
283 }
284
285 pub fn mut_name(&mut self) -> &mut ::std::string::String {
288 &mut self.name
289 }
290
291 pub fn take_name(&mut self) -> ::std::string::String {
293 ::std::mem::replace(&mut self.name, ::std::string::String::new())
294 }
295}
296
297impl ::protobuf::Message for TensorShapeProto_Dim {
298 fn is_initialized(&self) -> bool {
299 true
300 }
301
302 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
303 while !is.eof()? {
304 let (field_number, wire_type) = is.read_tag_unpack()?;
305 match field_number {
306 1 => {
307 if wire_type != ::protobuf::wire_format::WireTypeVarint {
308 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
309 }
310 let tmp = is.read_int64()?;
311 self.size = tmp;
312 },
313 2 => {
314 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
315 },
316 _ => {
317 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
318 },
319 };
320 }
321 ::std::result::Result::Ok(())
322 }
323
324 #[allow(unused_variables)]
326 fn compute_size(&self) -> u32 {
327 let mut my_size = 0;
328 if self.size != 0 {
329 my_size += ::protobuf::rt::value_size(1, self.size, ::protobuf::wire_format::WireTypeVarint);
330 }
331 if !self.name.is_empty() {
332 my_size += ::protobuf::rt::string_size(2, &self.name);
333 }
334 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
335 self.cached_size.set(my_size);
336 my_size
337 }
338
339 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
340 if self.size != 0 {
341 os.write_int64(1, self.size)?;
342 }
343 if !self.name.is_empty() {
344 os.write_string(2, &self.name)?;
345 }
346 os.write_unknown_fields(self.get_unknown_fields())?;
347 ::std::result::Result::Ok(())
348 }
349
350 fn get_cached_size(&self) -> u32 {
351 self.cached_size.get()
352 }
353
354 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
355 &self.unknown_fields
356 }
357
358 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
359 &mut self.unknown_fields
360 }
361
362 fn as_any(&self) -> &dyn (::std::any::Any) {
363 self as &dyn (::std::any::Any)
364 }
365 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
366 self as &mut dyn (::std::any::Any)
367 }
368 fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
369 self
370 }
371
372 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
373 Self::descriptor_static()
374 }
375
376 fn new() -> TensorShapeProto_Dim {
377 TensorShapeProto_Dim::new()
378 }
379
380 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
381 static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
382 unsafe {
383 descriptor.get(|| {
384 let mut fields = ::std::vec::Vec::new();
385 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
386 "size",
387 |m: &TensorShapeProto_Dim| { &m.size },
388 |m: &mut TensorShapeProto_Dim| { &mut m.size },
389 ));
390 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
391 "name",
392 |m: &TensorShapeProto_Dim| { &m.name },
393 |m: &mut TensorShapeProto_Dim| { &mut m.name },
394 ));
395 ::protobuf::reflect::MessageDescriptor::new_pb_name::<TensorShapeProto_Dim>(
396 "TensorShapeProto.Dim",
397 fields,
398 file_descriptor_proto()
399 )
400 })
401 }
402 }
403
404 fn default_instance() -> &'static TensorShapeProto_Dim {
405 static mut instance: ::protobuf::lazy::Lazy<TensorShapeProto_Dim> = ::protobuf::lazy::Lazy::INIT;
406 unsafe {
407 instance.get(TensorShapeProto_Dim::new)
408 }
409 }
410}
411
412impl ::protobuf::Clear for TensorShapeProto_Dim {
413 fn clear(&mut self) {
414 self.size = 0;
415 self.name.clear();
416 self.unknown_fields.clear();
417 }
418}
419
420impl ::std::fmt::Debug for TensorShapeProto_Dim {
421 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
422 ::protobuf::text_format::fmt(self, f)
423 }
424}
425
426impl ::protobuf::reflect::ProtobufValue for TensorShapeProto_Dim {
427 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
428 ::protobuf::reflect::ReflectValueRef::Message(self)
429 }
430}
431
432static file_descriptor_proto_data: &'static [u8] = b"\
433 \n,tensorflow/core/framework/tensor_shape.proto\x12\ntensorflow\"\x98\
434 \x01\n\x10TensorShapeProto\x122\n\x03dim\x18\x02\x20\x03(\x0b2\x20.tenso\
435 rflow.TensorShapeProto.DimR\x03dim\x12!\n\x0cunknown_rank\x18\x03\x20\
436 \x01(\x08R\x0bunknownRank\x1a-\n\x03Dim\x12\x12\n\x04size\x18\x01\x20\
437 \x01(\x03R\x04size\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04nameB\x87\
438 \x01\n\x18org.tensorflow.frameworkB\x11TensorShapeProtosP\x01ZSgithub.co\
439 m/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_pro\
440 to\xf8\x01\x01J\x8b\x0c\n\x06\x12\x04\x02\0-\x02\n>\n\x01\x0c\x12\x03\
441 \x02\0\x1224\x20Protocol\x20buffer\x20representing\x20the\x20shape\x20of\
442 \x20tensors.\n\n\x08\n\x01\x08\x12\x03\x03\0\x1f\n\t\n\x02\x08\x1f\x12\
443 \x03\x03\0\x1f\n\x08\n\x01\x08\x12\x03\x04\02\n\t\n\x02\x08\x08\x12\x03\
444 \x04\02\n\x08\n\x01\x08\x12\x03\x05\0\"\n\t\n\x02\x08\n\x12\x03\x05\0\"\
445 \n\x08\n\x01\x08\x12\x03\x06\01\n\t\n\x02\x08\x01\x12\x03\x06\01\n\x08\n\
446 \x01\x08\x12\x03\x07\0j\n\t\n\x02\x08\x0b\x12\x03\x07\0j\n\x08\n\x01\x02\
447 \x12\x03\t\0\x13\n%\n\x02\x04\0\x12\x04\x0c\0-\x01\x1a\x19\x20Dimensions\
448 \x20of\x20a\x20tensor.\n\n\n\n\x03\x04\0\x01\x12\x03\x0c\x08\x18\n,\n\
449 \x04\x04\0\x03\0\x12\x04\x0e\x02\x18\x03\x1a\x1e\x20One\x20dimension\x20\
450 of\x20the\x20tensor.\n\n\x0c\n\x05\x04\0\x03\0\x01\x12\x03\x0e\n\r\n\xbb\
451 \x02\n\x06\x04\0\x03\0\x02\0\x12\x03\x14\x04\x13\x1a\xab\x02\x20Size\x20\
452 of\x20the\x20tensor\x20in\x20that\x20dimension.\n\x20This\x20value\x20mu\
453 st\x20be\x20>=\x20-1,\x20but\x20values\x20of\x20-1\x20are\x20reserved\
454 \x20for\x20\"unknown\"\n\x20shapes\x20(values\x20of\x20-1\x20mean\x20\"u\
455 nknown\"\x20dimension).\x20\x20Certain\x20wrappers\n\x20that\x20work\x20\
456 with\x20TensorShapeProto\x20may\x20fail\x20at\x20runtime\x20when\x20dese\
457 rializing\n\x20a\x20TensorShapeProto\x20containing\x20a\x20dim\x20value\
458 \x20of\x20-1.\n\n\x0e\n\x07\x04\0\x03\0\x02\0\x05\x12\x03\x14\x04\t\n\
459 \x0e\n\x07\x04\0\x03\0\x02\0\x01\x12\x03\x14\n\x0e\n\x0e\n\x07\x04\0\x03\
460 \0\x02\0\x03\x12\x03\x14\x11\x12\n7\n\x06\x04\0\x03\0\x02\x01\x12\x03\
461 \x17\x04\x14\x1a(\x20Optional\x20name\x20of\x20the\x20tensor\x20dimensio\
462 n.\n\n\x0e\n\x07\x04\0\x03\0\x02\x01\x05\x12\x03\x17\x04\n\n\x0e\n\x07\
463 \x04\0\x03\0\x02\x01\x01\x12\x03\x17\x0b\x0f\n\x0e\n\x07\x04\0\x03\0\x02\
464 \x01\x03\x12\x03\x17\x12\x13\n\xb7\x04\n\x04\x04\0\x02\0\x12\x03'\x02\
465 \x17\x1a\xa9\x04\x20Dimensions\x20of\x20the\x20tensor,\x20such\x20as\x20\
466 {\"input\",\x2030},\x20{\"output\",\x2040}\n\x20for\x20a\x2030\x20x\x204\
467 0\x202D\x20tensor.\x20\x20If\x20an\x20entry\x20has\x20size\x20-1,\x20thi\
468 s\n\x20corresponds\x20to\x20a\x20dimension\x20of\x20unknown\x20size.\x20\
469 The\x20names\x20are\n\x20optional.\n\n\x20The\x20order\x20of\x20entries\
470 \x20in\x20\"dim\"\x20matters:\x20It\x20indicates\x20the\x20layout\x20of\
471 \x20the\n\x20values\x20in\x20the\x20tensor\x20in-memory\x20representatio\
472 n.\n\n\x20The\x20first\x20entry\x20in\x20\"dim\"\x20is\x20the\x20outermo\
473 st\x20dimension\x20used\x20to\x20layout\x20the\n\x20values,\x20the\x20la\
474 st\x20entry\x20is\x20the\x20innermost\x20dimension.\x20\x20This\x20match\
475 es\x20the\n\x20in-memory\x20layout\x20of\x20RowMajor\x20Eigen\x20tensors\
476 .\n\n\x20If\x20\"dim.size()\"\x20>\x200,\x20\"unknown_rank\"\x20must\x20\
477 be\x20false.\n\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03'\x02\n\n\x0c\n\x05\
478 \x04\0\x02\0\x06\x12\x03'\x0b\x0e\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03'\
479 \x0f\x12\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03'\x15\x16\nl\n\x04\x04\0\x02\
480 \x01\x12\x03,\x02\x18\x1a_\x20If\x20true,\x20the\x20number\x20of\x20dime\
481 nsions\x20in\x20the\x20shape\x20is\x20unknown.\n\n\x20If\x20true,\x20\"d\
482 im.size()\"\x20must\x20be\x200.\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03,\
483 \x02\x06\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03,\x07\x13\n\x0c\n\x05\x04\
484 \0\x02\x01\x03\x12\x03,\x16\x17b\x06proto3\
485";
486
487static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
488
489fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
490 ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
491}
492
493pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
494 unsafe {
495 file_descriptor_proto_lazy.get(|| {
496 parse_descriptor_proto()
497 })
498 }
499}