tensorboard_proto/
tensor_shape.rs

1// This file is generated by rust-protobuf 2.27.1. Do not edit
2// @generated
3
4// https://github.com/rust-lang/rust-clippy/issues/702
5#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![allow(unused_attributes)]
9#![cfg_attr(rustfmt, rustfmt::skip)]
10
11#![allow(box_pointers)]
12#![allow(dead_code)]
13#![allow(missing_docs)]
14#![allow(non_camel_case_types)]
15#![allow(non_snake_case)]
16#![allow(non_upper_case_globals)]
17#![allow(trivial_casts)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20//! Generated file from `src/tensor_shape.proto`
21
22/// Generated files are compatible only with the same version
23/// of protobuf runtime.
24// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_27_1;
25
26#[derive(PartialEq,Clone,Default)]
27pub struct TensorShapeProto {
28    // message fields
29    pub dim: ::protobuf::RepeatedField<TensorShapeProto_Dim>,
30    pub unknown_rank: bool,
31    // special fields
32    pub unknown_fields: ::protobuf::UnknownFields,
33    pub cached_size: ::protobuf::CachedSize,
34}
35
36impl<'a> ::std::default::Default for &'a TensorShapeProto {
37    fn default() -> &'a TensorShapeProto {
38        <TensorShapeProto as ::protobuf::Message>::default_instance()
39    }
40}
41
42impl TensorShapeProto {
43    pub fn new() -> TensorShapeProto {
44        ::std::default::Default::default()
45    }
46
47    // repeated .tensorboardrs.TensorShapeProto.Dim dim = 2;
48
49
50    pub fn get_dim(&self) -> &[TensorShapeProto_Dim] {
51        &self.dim
52    }
53    pub fn clear_dim(&mut self) {
54        self.dim.clear();
55    }
56
57    // Param is passed by value, moved
58    pub fn set_dim(&mut self, v: ::protobuf::RepeatedField<TensorShapeProto_Dim>) {
59        self.dim = v;
60    }
61
62    // Mutable pointer to the field.
63    pub fn mut_dim(&mut self) -> &mut ::protobuf::RepeatedField<TensorShapeProto_Dim> {
64        &mut self.dim
65    }
66
67    // Take field
68    pub fn take_dim(&mut self) -> ::protobuf::RepeatedField<TensorShapeProto_Dim> {
69        ::std::mem::replace(&mut self.dim, ::protobuf::RepeatedField::new())
70    }
71
72    // bool unknown_rank = 3;
73
74
75    pub fn get_unknown_rank(&self) -> bool {
76        self.unknown_rank
77    }
78    pub fn clear_unknown_rank(&mut self) {
79        self.unknown_rank = false;
80    }
81
82    // Param is passed by value, moved
83    pub fn set_unknown_rank(&mut self, v: bool) {
84        self.unknown_rank = v;
85    }
86}
87
88impl ::protobuf::Message for TensorShapeProto {
89    fn is_initialized(&self) -> bool {
90        for v in &self.dim {
91            if !v.is_initialized() {
92                return false;
93            }
94        };
95        true
96    }
97
98    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
99        while !is.eof()? {
100            let (field_number, wire_type) = is.read_tag_unpack()?;
101            match field_number {
102                2 => {
103                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.dim)?;
104                },
105                3 => {
106                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
107                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
108                    }
109                    let tmp = is.read_bool()?;
110                    self.unknown_rank = tmp;
111                },
112                _ => {
113                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
114                },
115            };
116        }
117        ::std::result::Result::Ok(())
118    }
119
120    // Compute sizes of nested messages
121    #[allow(unused_variables)]
122    fn compute_size(&self) -> u32 {
123        let mut my_size = 0;
124        for value in &self.dim {
125            let len = value.compute_size();
126            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
127        };
128        if self.unknown_rank != false {
129            my_size += 2;
130        }
131        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
132        self.cached_size.set(my_size);
133        my_size
134    }
135
136    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
137        for v in &self.dim {
138            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
139            os.write_raw_varint32(v.get_cached_size())?;
140            v.write_to_with_cached_sizes(os)?;
141        };
142        if self.unknown_rank != false {
143            os.write_bool(3, self.unknown_rank)?;
144        }
145        os.write_unknown_fields(self.get_unknown_fields())?;
146        ::std::result::Result::Ok(())
147    }
148
149    fn get_cached_size(&self) -> u32 {
150        self.cached_size.get()
151    }
152
153    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
154        &self.unknown_fields
155    }
156
157    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
158        &mut self.unknown_fields
159    }
160
161    fn as_any(&self) -> &dyn (::std::any::Any) {
162        self as &dyn (::std::any::Any)
163    }
164    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
165        self as &mut dyn (::std::any::Any)
166    }
167    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
168        self
169    }
170
171    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
172        Self::descriptor_static()
173    }
174
175    fn new() -> TensorShapeProto {
176        TensorShapeProto::new()
177    }
178
179    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
180        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
181        descriptor.get(|| {
182            let mut fields = ::std::vec::Vec::new();
183            fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<TensorShapeProto_Dim>>(
184                "dim",
185                |m: &TensorShapeProto| { &m.dim },
186                |m: &mut TensorShapeProto| { &mut m.dim },
187            ));
188            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
189                "unknown_rank",
190                |m: &TensorShapeProto| { &m.unknown_rank },
191                |m: &mut TensorShapeProto| { &mut m.unknown_rank },
192            ));
193            ::protobuf::reflect::MessageDescriptor::new_pb_name::<TensorShapeProto>(
194                "TensorShapeProto",
195                fields,
196                file_descriptor_proto()
197            )
198        })
199    }
200
201    fn default_instance() -> &'static TensorShapeProto {
202        static instance: ::protobuf::rt::LazyV2<TensorShapeProto> = ::protobuf::rt::LazyV2::INIT;
203        instance.get(TensorShapeProto::new)
204    }
205}
206
207impl ::protobuf::Clear for TensorShapeProto {
208    fn clear(&mut self) {
209        self.dim.clear();
210        self.unknown_rank = false;
211        self.unknown_fields.clear();
212    }
213}
214
215impl ::std::fmt::Debug for TensorShapeProto {
216    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
217        ::protobuf::text_format::fmt(self, f)
218    }
219}
220
221impl ::protobuf::reflect::ProtobufValue for TensorShapeProto {
222    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
223        ::protobuf::reflect::ReflectValueRef::Message(self)
224    }
225}
226
227#[derive(PartialEq,Clone,Default)]
228pub struct TensorShapeProto_Dim {
229    // message fields
230    pub size: i64,
231    pub name: ::std::string::String,
232    // special fields
233    pub unknown_fields: ::protobuf::UnknownFields,
234    pub cached_size: ::protobuf::CachedSize,
235}
236
237impl<'a> ::std::default::Default for &'a TensorShapeProto_Dim {
238    fn default() -> &'a TensorShapeProto_Dim {
239        <TensorShapeProto_Dim as ::protobuf::Message>::default_instance()
240    }
241}
242
243impl TensorShapeProto_Dim {
244    pub fn new() -> TensorShapeProto_Dim {
245        ::std::default::Default::default()
246    }
247
248    // int64 size = 1;
249
250
251    pub fn get_size(&self) -> i64 {
252        self.size
253    }
254    pub fn clear_size(&mut self) {
255        self.size = 0;
256    }
257
258    // Param is passed by value, moved
259    pub fn set_size(&mut self, v: i64) {
260        self.size = v;
261    }
262
263    // string name = 2;
264
265
266    pub fn get_name(&self) -> &str {
267        &self.name
268    }
269    pub fn clear_name(&mut self) {
270        self.name.clear();
271    }
272
273    // Param is passed by value, moved
274    pub fn set_name(&mut self, v: ::std::string::String) {
275        self.name = v;
276    }
277
278    // Mutable pointer to the field.
279    // If field is not initialized, it is initialized with default value first.
280    pub fn mut_name(&mut self) -> &mut ::std::string::String {
281        &mut self.name
282    }
283
284    // Take field
285    pub fn take_name(&mut self) -> ::std::string::String {
286        ::std::mem::replace(&mut self.name, ::std::string::String::new())
287    }
288}
289
290impl ::protobuf::Message for TensorShapeProto_Dim {
291    fn is_initialized(&self) -> bool {
292        true
293    }
294
295    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
296        while !is.eof()? {
297            let (field_number, wire_type) = is.read_tag_unpack()?;
298            match field_number {
299                1 => {
300                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
301                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
302                    }
303                    let tmp = is.read_int64()?;
304                    self.size = tmp;
305                },
306                2 => {
307                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
308                },
309                _ => {
310                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
311                },
312            };
313        }
314        ::std::result::Result::Ok(())
315    }
316
317    // Compute sizes of nested messages
318    #[allow(unused_variables)]
319    fn compute_size(&self) -> u32 {
320        let mut my_size = 0;
321        if self.size != 0 {
322            my_size += ::protobuf::rt::value_size(1, self.size, ::protobuf::wire_format::WireTypeVarint);
323        }
324        if !self.name.is_empty() {
325            my_size += ::protobuf::rt::string_size(2, &self.name);
326        }
327        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
328        self.cached_size.set(my_size);
329        my_size
330    }
331
332    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
333        if self.size != 0 {
334            os.write_int64(1, self.size)?;
335        }
336        if !self.name.is_empty() {
337            os.write_string(2, &self.name)?;
338        }
339        os.write_unknown_fields(self.get_unknown_fields())?;
340        ::std::result::Result::Ok(())
341    }
342
343    fn get_cached_size(&self) -> u32 {
344        self.cached_size.get()
345    }
346
347    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
348        &self.unknown_fields
349    }
350
351    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
352        &mut self.unknown_fields
353    }
354
355    fn as_any(&self) -> &dyn (::std::any::Any) {
356        self as &dyn (::std::any::Any)
357    }
358    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
359        self as &mut dyn (::std::any::Any)
360    }
361    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
362        self
363    }
364
365    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
366        Self::descriptor_static()
367    }
368
369    fn new() -> TensorShapeProto_Dim {
370        TensorShapeProto_Dim::new()
371    }
372
373    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
374        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
375        descriptor.get(|| {
376            let mut fields = ::std::vec::Vec::new();
377            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
378                "size",
379                |m: &TensorShapeProto_Dim| { &m.size },
380                |m: &mut TensorShapeProto_Dim| { &mut m.size },
381            ));
382            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
383                "name",
384                |m: &TensorShapeProto_Dim| { &m.name },
385                |m: &mut TensorShapeProto_Dim| { &mut m.name },
386            ));
387            ::protobuf::reflect::MessageDescriptor::new_pb_name::<TensorShapeProto_Dim>(
388                "TensorShapeProto.Dim",
389                fields,
390                file_descriptor_proto()
391            )
392        })
393    }
394
395    fn default_instance() -> &'static TensorShapeProto_Dim {
396        static instance: ::protobuf::rt::LazyV2<TensorShapeProto_Dim> = ::protobuf::rt::LazyV2::INIT;
397        instance.get(TensorShapeProto_Dim::new)
398    }
399}
400
401impl ::protobuf::Clear for TensorShapeProto_Dim {
402    fn clear(&mut self) {
403        self.size = 0;
404        self.name.clear();
405        self.unknown_fields.clear();
406    }
407}
408
409impl ::std::fmt::Debug for TensorShapeProto_Dim {
410    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
411        ::protobuf::text_format::fmt(self, f)
412    }
413}
414
415impl ::protobuf::reflect::ProtobufValue for TensorShapeProto_Dim {
416    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
417        ::protobuf::reflect::ReflectValueRef::Message(self)
418    }
419}
420
421static file_descriptor_proto_data: &'static [u8] = b"\
422    \n\x16src/tensor_shape.proto\x12\rtensorboardrs\"\x9b\x01\n\x10TensorSha\
423    peProto\x125\n\x03dim\x18\x02\x20\x03(\x0b2#.tensorboardrs.TensorShapePr\
424    oto.DimR\x03dim\x12!\n\x0cunknown_rank\x18\x03\x20\x01(\x08R\x0bunknownR\
425    ank\x1a-\n\x03Dim\x12\x12\n\x04size\x18\x01\x20\x01(\x03R\x04size\x12\
426    \x12\n\x04name\x18\x02\x20\x01(\tR\x04nameB2\n\x18org.tensorflow.framewo\
427    rkB\x11TensorShapeProtosP\x01\xf8\x01\x01J\xf6\x0b\n\x06\x12\x04\x02\0,\
428    \x02\n>\n\x01\x0c\x12\x03\x02\0\x1224\x20Protocol\x20buffer\x20represent\
429    ing\x20the\x20shape\x20of\x20tensors.\n\n\x08\n\x01\x08\x12\x03\x03\0\
430    \x1f\n\t\n\x02\x08\x1f\x12\x03\x03\0\x1f\n\x08\n\x01\x08\x12\x03\x04\02\
431    \n\t\n\x02\x08\x08\x12\x03\x04\02\n\x08\n\x01\x08\x12\x03\x05\0\"\n\t\n\
432    \x02\x08\n\x12\x03\x05\0\"\n\x08\n\x01\x08\x12\x03\x06\01\n\t\n\x02\x08\
433    \x01\x12\x03\x06\01\n\x08\n\x01\x02\x12\x03\x08\0\x16\n%\n\x02\x04\0\x12\
434    \x04\x0b\0,\x01\x1a\x19\x20Dimensions\x20of\x20a\x20tensor.\n\n\n\n\x03\
435    \x04\0\x01\x12\x03\x0b\x08\x18\n,\n\x04\x04\0\x03\0\x12\x04\r\x02\x17\
436    \x03\x1a\x1e\x20One\x20dimension\x20of\x20the\x20tensor.\n\n\x0c\n\x05\
437    \x04\0\x03\0\x01\x12\x03\r\n\r\n\xbb\x02\n\x06\x04\0\x03\0\x02\0\x12\x03\
438    \x13\x04\x13\x1a\xab\x02\x20Size\x20of\x20the\x20tensor\x20in\x20that\
439    \x20dimension.\n\x20This\x20value\x20must\x20be\x20>=\x20-1,\x20but\x20v\
440    alues\x20of\x20-1\x20are\x20reserved\x20for\x20\"unknown\"\n\x20shapes\
441    \x20(values\x20of\x20-1\x20mean\x20\"unknown\"\x20dimension).\x20\x20Cer\
442    tain\x20wrappers\n\x20that\x20work\x20with\x20TensorShapeProto\x20may\
443    \x20fail\x20at\x20runtime\x20when\x20deserializing\n\x20a\x20TensorShape\
444    Proto\x20containing\x20a\x20dim\x20value\x20of\x20-1.\n\n\x0e\n\x07\x04\
445    \0\x03\0\x02\0\x05\x12\x03\x13\x04\t\n\x0e\n\x07\x04\0\x03\0\x02\0\x01\
446    \x12\x03\x13\n\x0e\n\x0e\n\x07\x04\0\x03\0\x02\0\x03\x12\x03\x13\x11\x12\
447    \n7\n\x06\x04\0\x03\0\x02\x01\x12\x03\x16\x04\x14\x1a(\x20Optional\x20na\
448    me\x20of\x20the\x20tensor\x20dimension.\n\n\x0e\n\x07\x04\0\x03\0\x02\
449    \x01\x05\x12\x03\x16\x04\n\n\x0e\n\x07\x04\0\x03\0\x02\x01\x01\x12\x03\
450    \x16\x0b\x0f\n\x0e\n\x07\x04\0\x03\0\x02\x01\x03\x12\x03\x16\x12\x13\n\
451    \xb7\x04\n\x04\x04\0\x02\0\x12\x03&\x02\x17\x1a\xa9\x04\x20Dimensions\
452    \x20of\x20the\x20tensor,\x20such\x20as\x20{\"input\",\x2030},\x20{\"outp\
453    ut\",\x2040}\n\x20for\x20a\x2030\x20x\x2040\x202D\x20tensor.\x20\x20If\
454    \x20an\x20entry\x20has\x20size\x20-1,\x20this\n\x20corresponds\x20to\x20\
455    a\x20dimension\x20of\x20unknown\x20size.\x20The\x20names\x20are\n\x20opt\
456    ional.\n\n\x20The\x20order\x20of\x20entries\x20in\x20\"dim\"\x20matters:\
457    \x20It\x20indicates\x20the\x20layout\x20of\x20the\n\x20values\x20in\x20t\
458    he\x20tensor\x20in-memory\x20representation.\n\n\x20The\x20first\x20entr\
459    y\x20in\x20\"dim\"\x20is\x20the\x20outermost\x20dimension\x20used\x20to\
460    \x20layout\x20the\n\x20values,\x20the\x20last\x20entry\x20is\x20the\x20i\
461    nnermost\x20dimension.\x20\x20This\x20matches\x20the\n\x20in-memory\x20l\
462    ayout\x20of\x20RowMajor\x20Eigen\x20tensors.\n\n\x20If\x20\"dim.size()\"\
463    \x20>\x200,\x20\"unknown_rank\"\x20must\x20be\x20false.\n\n\x0c\n\x05\
464    \x04\0\x02\0\x04\x12\x03&\x02\n\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03&\x0b\
465    \x0e\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03&\x0f\x12\n\x0c\n\x05\x04\0\x02\
466    \0\x03\x12\x03&\x15\x16\nl\n\x04\x04\0\x02\x01\x12\x03+\x02\x18\x1a_\x20\
467    If\x20true,\x20the\x20number\x20of\x20dimensions\x20in\x20the\x20shape\
468    \x20is\x20unknown.\n\n\x20If\x20true,\x20\"dim.size()\"\x20must\x20be\
469    \x200.\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03+\x02\x06\n\x0c\n\x05\x04\
470    \0\x02\x01\x01\x12\x03+\x07\x13\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03+\
471    \x16\x17b\x06proto3\
472";
473
474static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
475
476fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
477    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
478}
479
480pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
481    file_descriptor_proto_lazy.get(|| {
482        parse_descriptor_proto()
483    })
484}