tensorboard_proto/
tensor.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.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 TensorProto {
28    // message fields
29    pub dtype: super::types::DataType,
30    pub tensor_shape: ::protobuf::SingularPtrField<super::tensor_shape::TensorShapeProto>,
31    pub version_number: i32,
32    pub tensor_content: ::std::vec::Vec<u8>,
33    pub half_val: ::std::vec::Vec<i32>,
34    pub float_val: ::std::vec::Vec<f32>,
35    pub double_val: ::std::vec::Vec<f64>,
36    pub int_val: ::std::vec::Vec<i32>,
37    pub string_val: ::protobuf::RepeatedField<::std::vec::Vec<u8>>,
38    pub scomplex_val: ::std::vec::Vec<f32>,
39    pub int64_val: ::std::vec::Vec<i64>,
40    pub bool_val: ::std::vec::Vec<bool>,
41    pub dcomplex_val: ::std::vec::Vec<f64>,
42    pub resource_handle_val: ::protobuf::RepeatedField<super::resource_handle::ResourceHandleProto>,
43    // special fields
44    pub unknown_fields: ::protobuf::UnknownFields,
45    pub cached_size: ::protobuf::CachedSize,
46}
47
48impl<'a> ::std::default::Default for &'a TensorProto {
49    fn default() -> &'a TensorProto {
50        <TensorProto as ::protobuf::Message>::default_instance()
51    }
52}
53
54impl TensorProto {
55    pub fn new() -> TensorProto {
56        ::std::default::Default::default()
57    }
58
59    // .tensorboardrs.DataType dtype = 1;
60
61
62    pub fn get_dtype(&self) -> super::types::DataType {
63        self.dtype
64    }
65    pub fn clear_dtype(&mut self) {
66        self.dtype = super::types::DataType::DT_INVALID;
67    }
68
69    // Param is passed by value, moved
70    pub fn set_dtype(&mut self, v: super::types::DataType) {
71        self.dtype = v;
72    }
73
74    // .tensorboardrs.TensorShapeProto tensor_shape = 2;
75
76
77    pub fn get_tensor_shape(&self) -> &super::tensor_shape::TensorShapeProto {
78        self.tensor_shape.as_ref().unwrap_or_else(|| <super::tensor_shape::TensorShapeProto as ::protobuf::Message>::default_instance())
79    }
80    pub fn clear_tensor_shape(&mut self) {
81        self.tensor_shape.clear();
82    }
83
84    pub fn has_tensor_shape(&self) -> bool {
85        self.tensor_shape.is_some()
86    }
87
88    // Param is passed by value, moved
89    pub fn set_tensor_shape(&mut self, v: super::tensor_shape::TensorShapeProto) {
90        self.tensor_shape = ::protobuf::SingularPtrField::some(v);
91    }
92
93    // Mutable pointer to the field.
94    // If field is not initialized, it is initialized with default value first.
95    pub fn mut_tensor_shape(&mut self) -> &mut super::tensor_shape::TensorShapeProto {
96        if self.tensor_shape.is_none() {
97            self.tensor_shape.set_default();
98        }
99        self.tensor_shape.as_mut().unwrap()
100    }
101
102    // Take field
103    pub fn take_tensor_shape(&mut self) -> super::tensor_shape::TensorShapeProto {
104        self.tensor_shape.take().unwrap_or_else(|| super::tensor_shape::TensorShapeProto::new())
105    }
106
107    // int32 version_number = 3;
108
109
110    pub fn get_version_number(&self) -> i32 {
111        self.version_number
112    }
113    pub fn clear_version_number(&mut self) {
114        self.version_number = 0;
115    }
116
117    // Param is passed by value, moved
118    pub fn set_version_number(&mut self, v: i32) {
119        self.version_number = v;
120    }
121
122    // bytes tensor_content = 4;
123
124
125    pub fn get_tensor_content(&self) -> &[u8] {
126        &self.tensor_content
127    }
128    pub fn clear_tensor_content(&mut self) {
129        self.tensor_content.clear();
130    }
131
132    // Param is passed by value, moved
133    pub fn set_tensor_content(&mut self, v: ::std::vec::Vec<u8>) {
134        self.tensor_content = v;
135    }
136
137    // Mutable pointer to the field.
138    // If field is not initialized, it is initialized with default value first.
139    pub fn mut_tensor_content(&mut self) -> &mut ::std::vec::Vec<u8> {
140        &mut self.tensor_content
141    }
142
143    // Take field
144    pub fn take_tensor_content(&mut self) -> ::std::vec::Vec<u8> {
145        ::std::mem::replace(&mut self.tensor_content, ::std::vec::Vec::new())
146    }
147
148    // repeated int32 half_val = 13;
149
150
151    pub fn get_half_val(&self) -> &[i32] {
152        &self.half_val
153    }
154    pub fn clear_half_val(&mut self) {
155        self.half_val.clear();
156    }
157
158    // Param is passed by value, moved
159    pub fn set_half_val(&mut self, v: ::std::vec::Vec<i32>) {
160        self.half_val = v;
161    }
162
163    // Mutable pointer to the field.
164    pub fn mut_half_val(&mut self) -> &mut ::std::vec::Vec<i32> {
165        &mut self.half_val
166    }
167
168    // Take field
169    pub fn take_half_val(&mut self) -> ::std::vec::Vec<i32> {
170        ::std::mem::replace(&mut self.half_val, ::std::vec::Vec::new())
171    }
172
173    // repeated float float_val = 5;
174
175
176    pub fn get_float_val(&self) -> &[f32] {
177        &self.float_val
178    }
179    pub fn clear_float_val(&mut self) {
180        self.float_val.clear();
181    }
182
183    // Param is passed by value, moved
184    pub fn set_float_val(&mut self, v: ::std::vec::Vec<f32>) {
185        self.float_val = v;
186    }
187
188    // Mutable pointer to the field.
189    pub fn mut_float_val(&mut self) -> &mut ::std::vec::Vec<f32> {
190        &mut self.float_val
191    }
192
193    // Take field
194    pub fn take_float_val(&mut self) -> ::std::vec::Vec<f32> {
195        ::std::mem::replace(&mut self.float_val, ::std::vec::Vec::new())
196    }
197
198    // repeated double double_val = 6;
199
200
201    pub fn get_double_val(&self) -> &[f64] {
202        &self.double_val
203    }
204    pub fn clear_double_val(&mut self) {
205        self.double_val.clear();
206    }
207
208    // Param is passed by value, moved
209    pub fn set_double_val(&mut self, v: ::std::vec::Vec<f64>) {
210        self.double_val = v;
211    }
212
213    // Mutable pointer to the field.
214    pub fn mut_double_val(&mut self) -> &mut ::std::vec::Vec<f64> {
215        &mut self.double_val
216    }
217
218    // Take field
219    pub fn take_double_val(&mut self) -> ::std::vec::Vec<f64> {
220        ::std::mem::replace(&mut self.double_val, ::std::vec::Vec::new())
221    }
222
223    // repeated int32 int_val = 7;
224
225
226    pub fn get_int_val(&self) -> &[i32] {
227        &self.int_val
228    }
229    pub fn clear_int_val(&mut self) {
230        self.int_val.clear();
231    }
232
233    // Param is passed by value, moved
234    pub fn set_int_val(&mut self, v: ::std::vec::Vec<i32>) {
235        self.int_val = v;
236    }
237
238    // Mutable pointer to the field.
239    pub fn mut_int_val(&mut self) -> &mut ::std::vec::Vec<i32> {
240        &mut self.int_val
241    }
242
243    // Take field
244    pub fn take_int_val(&mut self) -> ::std::vec::Vec<i32> {
245        ::std::mem::replace(&mut self.int_val, ::std::vec::Vec::new())
246    }
247
248    // repeated bytes string_val = 8;
249
250
251    pub fn get_string_val(&self) -> &[::std::vec::Vec<u8>] {
252        &self.string_val
253    }
254    pub fn clear_string_val(&mut self) {
255        self.string_val.clear();
256    }
257
258    // Param is passed by value, moved
259    pub fn set_string_val(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec<u8>>) {
260        self.string_val = v;
261    }
262
263    // Mutable pointer to the field.
264    pub fn mut_string_val(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec<u8>> {
265        &mut self.string_val
266    }
267
268    // Take field
269    pub fn take_string_val(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec<u8>> {
270        ::std::mem::replace(&mut self.string_val, ::protobuf::RepeatedField::new())
271    }
272
273    // repeated float scomplex_val = 9;
274
275
276    pub fn get_scomplex_val(&self) -> &[f32] {
277        &self.scomplex_val
278    }
279    pub fn clear_scomplex_val(&mut self) {
280        self.scomplex_val.clear();
281    }
282
283    // Param is passed by value, moved
284    pub fn set_scomplex_val(&mut self, v: ::std::vec::Vec<f32>) {
285        self.scomplex_val = v;
286    }
287
288    // Mutable pointer to the field.
289    pub fn mut_scomplex_val(&mut self) -> &mut ::std::vec::Vec<f32> {
290        &mut self.scomplex_val
291    }
292
293    // Take field
294    pub fn take_scomplex_val(&mut self) -> ::std::vec::Vec<f32> {
295        ::std::mem::replace(&mut self.scomplex_val, ::std::vec::Vec::new())
296    }
297
298    // repeated int64 int64_val = 10;
299
300
301    pub fn get_int64_val(&self) -> &[i64] {
302        &self.int64_val
303    }
304    pub fn clear_int64_val(&mut self) {
305        self.int64_val.clear();
306    }
307
308    // Param is passed by value, moved
309    pub fn set_int64_val(&mut self, v: ::std::vec::Vec<i64>) {
310        self.int64_val = v;
311    }
312
313    // Mutable pointer to the field.
314    pub fn mut_int64_val(&mut self) -> &mut ::std::vec::Vec<i64> {
315        &mut self.int64_val
316    }
317
318    // Take field
319    pub fn take_int64_val(&mut self) -> ::std::vec::Vec<i64> {
320        ::std::mem::replace(&mut self.int64_val, ::std::vec::Vec::new())
321    }
322
323    // repeated bool bool_val = 11;
324
325
326    pub fn get_bool_val(&self) -> &[bool] {
327        &self.bool_val
328    }
329    pub fn clear_bool_val(&mut self) {
330        self.bool_val.clear();
331    }
332
333    // Param is passed by value, moved
334    pub fn set_bool_val(&mut self, v: ::std::vec::Vec<bool>) {
335        self.bool_val = v;
336    }
337
338    // Mutable pointer to the field.
339    pub fn mut_bool_val(&mut self) -> &mut ::std::vec::Vec<bool> {
340        &mut self.bool_val
341    }
342
343    // Take field
344    pub fn take_bool_val(&mut self) -> ::std::vec::Vec<bool> {
345        ::std::mem::replace(&mut self.bool_val, ::std::vec::Vec::new())
346    }
347
348    // repeated double dcomplex_val = 12;
349
350
351    pub fn get_dcomplex_val(&self) -> &[f64] {
352        &self.dcomplex_val
353    }
354    pub fn clear_dcomplex_val(&mut self) {
355        self.dcomplex_val.clear();
356    }
357
358    // Param is passed by value, moved
359    pub fn set_dcomplex_val(&mut self, v: ::std::vec::Vec<f64>) {
360        self.dcomplex_val = v;
361    }
362
363    // Mutable pointer to the field.
364    pub fn mut_dcomplex_val(&mut self) -> &mut ::std::vec::Vec<f64> {
365        &mut self.dcomplex_val
366    }
367
368    // Take field
369    pub fn take_dcomplex_val(&mut self) -> ::std::vec::Vec<f64> {
370        ::std::mem::replace(&mut self.dcomplex_val, ::std::vec::Vec::new())
371    }
372
373    // repeated .tensorboardrs.ResourceHandleProto resource_handle_val = 14;
374
375
376    pub fn get_resource_handle_val(&self) -> &[super::resource_handle::ResourceHandleProto] {
377        &self.resource_handle_val
378    }
379    pub fn clear_resource_handle_val(&mut self) {
380        self.resource_handle_val.clear();
381    }
382
383    // Param is passed by value, moved
384    pub fn set_resource_handle_val(&mut self, v: ::protobuf::RepeatedField<super::resource_handle::ResourceHandleProto>) {
385        self.resource_handle_val = v;
386    }
387
388    // Mutable pointer to the field.
389    pub fn mut_resource_handle_val(&mut self) -> &mut ::protobuf::RepeatedField<super::resource_handle::ResourceHandleProto> {
390        &mut self.resource_handle_val
391    }
392
393    // Take field
394    pub fn take_resource_handle_val(&mut self) -> ::protobuf::RepeatedField<super::resource_handle::ResourceHandleProto> {
395        ::std::mem::replace(&mut self.resource_handle_val, ::protobuf::RepeatedField::new())
396    }
397}
398
399impl ::protobuf::Message for TensorProto {
400    fn is_initialized(&self) -> bool {
401        for v in &self.tensor_shape {
402            if !v.is_initialized() {
403                return false;
404            }
405        };
406        for v in &self.resource_handle_val {
407            if !v.is_initialized() {
408                return false;
409            }
410        };
411        true
412    }
413
414    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
415        while !is.eof()? {
416            let (field_number, wire_type) = is.read_tag_unpack()?;
417            match field_number {
418                1 => {
419                    ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.dtype, 1, &mut self.unknown_fields)?
420                },
421                2 => {
422                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.tensor_shape)?;
423                },
424                3 => {
425                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
426                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
427                    }
428                    let tmp = is.read_int32()?;
429                    self.version_number = tmp;
430                },
431                4 => {
432                    ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.tensor_content)?;
433                },
434                13 => {
435                    ::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.half_val)?;
436                },
437                5 => {
438                    ::protobuf::rt::read_repeated_float_into(wire_type, is, &mut self.float_val)?;
439                },
440                6 => {
441                    ::protobuf::rt::read_repeated_double_into(wire_type, is, &mut self.double_val)?;
442                },
443                7 => {
444                    ::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.int_val)?;
445                },
446                8 => {
447                    ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.string_val)?;
448                },
449                9 => {
450                    ::protobuf::rt::read_repeated_float_into(wire_type, is, &mut self.scomplex_val)?;
451                },
452                10 => {
453                    ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.int64_val)?;
454                },
455                11 => {
456                    ::protobuf::rt::read_repeated_bool_into(wire_type, is, &mut self.bool_val)?;
457                },
458                12 => {
459                    ::protobuf::rt::read_repeated_double_into(wire_type, is, &mut self.dcomplex_val)?;
460                },
461                14 => {
462                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.resource_handle_val)?;
463                },
464                _ => {
465                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
466                },
467            };
468        }
469        ::std::result::Result::Ok(())
470    }
471
472    // Compute sizes of nested messages
473    #[allow(unused_variables)]
474    fn compute_size(&self) -> u32 {
475        let mut my_size = 0;
476        if self.dtype != super::types::DataType::DT_INVALID {
477            my_size += ::protobuf::rt::enum_size(1, self.dtype);
478        }
479        if let Some(ref v) = self.tensor_shape.as_ref() {
480            let len = v.compute_size();
481            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
482        }
483        if self.version_number != 0 {
484            my_size += ::protobuf::rt::value_size(3, self.version_number, ::protobuf::wire_format::WireTypeVarint);
485        }
486        if !self.tensor_content.is_empty() {
487            my_size += ::protobuf::rt::bytes_size(4, &self.tensor_content);
488        }
489        if !self.half_val.is_empty() {
490            my_size += ::protobuf::rt::vec_packed_varint_size(13, &self.half_val);
491        }
492        if !self.float_val.is_empty() {
493            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.float_val.len() * 4) as u32) + (self.float_val.len() * 4) as u32;
494        }
495        if !self.double_val.is_empty() {
496            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.double_val.len() * 8) as u32) + (self.double_val.len() * 8) as u32;
497        }
498        if !self.int_val.is_empty() {
499            my_size += ::protobuf::rt::vec_packed_varint_size(7, &self.int_val);
500        }
501        for value in &self.string_val {
502            my_size += ::protobuf::rt::bytes_size(8, &value);
503        };
504        if !self.scomplex_val.is_empty() {
505            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.scomplex_val.len() * 4) as u32) + (self.scomplex_val.len() * 4) as u32;
506        }
507        if !self.int64_val.is_empty() {
508            my_size += ::protobuf::rt::vec_packed_varint_size(10, &self.int64_val);
509        }
510        if !self.bool_val.is_empty() {
511            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.bool_val.len() * 1) as u32) + (self.bool_val.len() * 1) as u32;
512        }
513        if !self.dcomplex_val.is_empty() {
514            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size((self.dcomplex_val.len() * 8) as u32) + (self.dcomplex_val.len() * 8) as u32;
515        }
516        for value in &self.resource_handle_val {
517            let len = value.compute_size();
518            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
519        };
520        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
521        self.cached_size.set(my_size);
522        my_size
523    }
524
525    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
526        if self.dtype != super::types::DataType::DT_INVALID {
527            os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.dtype))?;
528        }
529        if let Some(ref v) = self.tensor_shape.as_ref() {
530            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
531            os.write_raw_varint32(v.get_cached_size())?;
532            v.write_to_with_cached_sizes(os)?;
533        }
534        if self.version_number != 0 {
535            os.write_int32(3, self.version_number)?;
536        }
537        if !self.tensor_content.is_empty() {
538            os.write_bytes(4, &self.tensor_content)?;
539        }
540        if !self.half_val.is_empty() {
541            os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)?;
542            // TODO: Data size is computed again, it should be cached
543            os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.half_val))?;
544            for v in &self.half_val {
545                os.write_int32_no_tag(*v)?;
546            };
547        }
548        if !self.float_val.is_empty() {
549            os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?;
550            // TODO: Data size is computed again, it should be cached
551            os.write_raw_varint32((self.float_val.len() * 4) as u32)?;
552            for v in &self.float_val {
553                os.write_float_no_tag(*v)?;
554            };
555        }
556        if !self.double_val.is_empty() {
557            os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?;
558            // TODO: Data size is computed again, it should be cached
559            os.write_raw_varint32((self.double_val.len() * 8) as u32)?;
560            for v in &self.double_val {
561                os.write_double_no_tag(*v)?;
562            };
563        }
564        if !self.int_val.is_empty() {
565            os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?;
566            // TODO: Data size is computed again, it should be cached
567            os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.int_val))?;
568            for v in &self.int_val {
569                os.write_int32_no_tag(*v)?;
570            };
571        }
572        for v in &self.string_val {
573            os.write_bytes(8, &v)?;
574        };
575        if !self.scomplex_val.is_empty() {
576            os.write_tag(9, ::protobuf::wire_format::WireTypeLengthDelimited)?;
577            // TODO: Data size is computed again, it should be cached
578            os.write_raw_varint32((self.scomplex_val.len() * 4) as u32)?;
579            for v in &self.scomplex_val {
580                os.write_float_no_tag(*v)?;
581            };
582        }
583        if !self.int64_val.is_empty() {
584            os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
585            // TODO: Data size is computed again, it should be cached
586            os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.int64_val))?;
587            for v in &self.int64_val {
588                os.write_int64_no_tag(*v)?;
589            };
590        }
591        if !self.bool_val.is_empty() {
592            os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?;
593            // TODO: Data size is computed again, it should be cached
594            os.write_raw_varint32((self.bool_val.len() * 1) as u32)?;
595            for v in &self.bool_val {
596                os.write_bool_no_tag(*v)?;
597            };
598        }
599        if !self.dcomplex_val.is_empty() {
600            os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?;
601            // TODO: Data size is computed again, it should be cached
602            os.write_raw_varint32((self.dcomplex_val.len() * 8) as u32)?;
603            for v in &self.dcomplex_val {
604                os.write_double_no_tag(*v)?;
605            };
606        }
607        for v in &self.resource_handle_val {
608            os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)?;
609            os.write_raw_varint32(v.get_cached_size())?;
610            v.write_to_with_cached_sizes(os)?;
611        };
612        os.write_unknown_fields(self.get_unknown_fields())?;
613        ::std::result::Result::Ok(())
614    }
615
616    fn get_cached_size(&self) -> u32 {
617        self.cached_size.get()
618    }
619
620    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
621        &self.unknown_fields
622    }
623
624    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
625        &mut self.unknown_fields
626    }
627
628    fn as_any(&self) -> &dyn (::std::any::Any) {
629        self as &dyn (::std::any::Any)
630    }
631    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
632        self as &mut dyn (::std::any::Any)
633    }
634    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
635        self
636    }
637
638    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
639        Self::descriptor_static()
640    }
641
642    fn new() -> TensorProto {
643        TensorProto::new()
644    }
645
646    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
647        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
648        descriptor.get(|| {
649            let mut fields = ::std::vec::Vec::new();
650            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<super::types::DataType>>(
651                "dtype",
652                |m: &TensorProto| { &m.dtype },
653                |m: &mut TensorProto| { &mut m.dtype },
654            ));
655            fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::tensor_shape::TensorShapeProto>>(
656                "tensor_shape",
657                |m: &TensorProto| { &m.tensor_shape },
658                |m: &mut TensorProto| { &mut m.tensor_shape },
659            ));
660            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
661                "version_number",
662                |m: &TensorProto| { &m.version_number },
663                |m: &mut TensorProto| { &mut m.version_number },
664            ));
665            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
666                "tensor_content",
667                |m: &TensorProto| { &m.tensor_content },
668                |m: &mut TensorProto| { &mut m.tensor_content },
669            ));
670            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
671                "half_val",
672                |m: &TensorProto| { &m.half_val },
673                |m: &mut TensorProto| { &mut m.half_val },
674            ));
675            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeFloat>(
676                "float_val",
677                |m: &TensorProto| { &m.float_val },
678                |m: &mut TensorProto| { &mut m.float_val },
679            ));
680            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
681                "double_val",
682                |m: &TensorProto| { &m.double_val },
683                |m: &mut TensorProto| { &mut m.double_val },
684            ));
685            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
686                "int_val",
687                |m: &TensorProto| { &m.int_val },
688                |m: &mut TensorProto| { &mut m.int_val },
689            ));
690            fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
691                "string_val",
692                |m: &TensorProto| { &m.string_val },
693                |m: &mut TensorProto| { &mut m.string_val },
694            ));
695            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeFloat>(
696                "scomplex_val",
697                |m: &TensorProto| { &m.scomplex_val },
698                |m: &mut TensorProto| { &mut m.scomplex_val },
699            ));
700            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
701                "int64_val",
702                |m: &TensorProto| { &m.int64_val },
703                |m: &mut TensorProto| { &mut m.int64_val },
704            ));
705            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
706                "bool_val",
707                |m: &TensorProto| { &m.bool_val },
708                |m: &mut TensorProto| { &mut m.bool_val },
709            ));
710            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
711                "dcomplex_val",
712                |m: &TensorProto| { &m.dcomplex_val },
713                |m: &mut TensorProto| { &mut m.dcomplex_val },
714            ));
715            fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::resource_handle::ResourceHandleProto>>(
716                "resource_handle_val",
717                |m: &TensorProto| { &m.resource_handle_val },
718                |m: &mut TensorProto| { &mut m.resource_handle_val },
719            ));
720            ::protobuf::reflect::MessageDescriptor::new_pb_name::<TensorProto>(
721                "TensorProto",
722                fields,
723                file_descriptor_proto()
724            )
725        })
726    }
727
728    fn default_instance() -> &'static TensorProto {
729        static instance: ::protobuf::rt::LazyV2<TensorProto> = ::protobuf::rt::LazyV2::INIT;
730        instance.get(TensorProto::new)
731    }
732}
733
734impl ::protobuf::Clear for TensorProto {
735    fn clear(&mut self) {
736        self.dtype = super::types::DataType::DT_INVALID;
737        self.tensor_shape.clear();
738        self.version_number = 0;
739        self.tensor_content.clear();
740        self.half_val.clear();
741        self.float_val.clear();
742        self.double_val.clear();
743        self.int_val.clear();
744        self.string_val.clear();
745        self.scomplex_val.clear();
746        self.int64_val.clear();
747        self.bool_val.clear();
748        self.dcomplex_val.clear();
749        self.resource_handle_val.clear();
750        self.unknown_fields.clear();
751    }
752}
753
754impl ::std::fmt::Debug for TensorProto {
755    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
756        ::protobuf::text_format::fmt(self, f)
757    }
758}
759
760impl ::protobuf::reflect::ProtobufValue for TensorProto {
761    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
762        ::protobuf::reflect::ReflectValueRef::Message(self)
763    }
764}
765
766static file_descriptor_proto_data: &'static [u8] = b"\
767    \n\x10src/tensor.proto\x12\rtensorboardrs\x1a\x19src/resource_handle.pro\
768    to\x1a\x16src/tensor_shape.proto\x1a\x0fsrc/types.proto\"\xcf\x04\n\x0bT\
769    ensorProto\x12-\n\x05dtype\x18\x01\x20\x01(\x0e2\x17.tensorboardrs.DataT\
770    ypeR\x05dtype\x12B\n\x0ctensor_shape\x18\x02\x20\x01(\x0b2\x1f.tensorboa\
771    rdrs.TensorShapeProtoR\x0btensorShape\x12%\n\x0eversion_number\x18\x03\
772    \x20\x01(\x05R\rversionNumber\x12%\n\x0etensor_content\x18\x04\x20\x01(\
773    \x0cR\rtensorContent\x12\x1d\n\x08half_val\x18\r\x20\x03(\x05R\x07halfVa\
774    lB\x02\x10\x01\x12\x1f\n\tfloat_val\x18\x05\x20\x03(\x02R\x08floatValB\
775    \x02\x10\x01\x12!\n\ndouble_val\x18\x06\x20\x03(\x01R\tdoubleValB\x02\
776    \x10\x01\x12\x1b\n\x07int_val\x18\x07\x20\x03(\x05R\x06intValB\x02\x10\
777    \x01\x12\x1d\n\nstring_val\x18\x08\x20\x03(\x0cR\tstringVal\x12%\n\x0csc\
778    omplex_val\x18\t\x20\x03(\x02R\x0bscomplexValB\x02\x10\x01\x12\x1f\n\tin\
779    t64_val\x18\n\x20\x03(\x03R\x08int64ValB\x02\x10\x01\x12\x1d\n\x08bool_v\
780    al\x18\x0b\x20\x03(\x08R\x07boolValB\x02\x10\x01\x12%\n\x0cdcomplex_val\
781    \x18\x0c\x20\x03(\x01R\x0bdcomplexValB\x02\x10\x01\x12R\n\x13resource_ha\
782    ndle_val\x18\x0e\x20\x03(\x0b2\".tensorboardrs.ResourceHandleProtoR\x11r\
783    esourceHandleValB-\n\x18org.tensorflow.frameworkB\x0cTensorProtosP\x01\
784    \xf8\x01\x01J\xee\x16\n\x06\x12\x04\0\0J\x02\n\x08\n\x01\x0c\x12\x03\0\0\
785    \x12\n\x08\n\x01\x02\x12\x03\x02\0\x16\n\x08\n\x01\x08\x12\x03\x03\0\x1f\
786    \n\t\n\x02\x08\x1f\x12\x03\x03\0\x1f\n\x08\n\x01\x08\x12\x03\x04\0-\n\t\
787    \n\x02\x08\x08\x12\x03\x04\0-\n\x08\n\x01\x08\x12\x03\x05\0\"\n\t\n\x02\
788    \x08\n\x12\x03\x05\0\"\n\x08\n\x01\x08\x12\x03\x06\01\n\t\n\x02\x08\x01\
789    \x12\x03\x06\01\n\t\n\x02\x03\0\x12\x03\x08\0#\n\t\n\x02\x03\x01\x12\x03\
790    \t\0\x20\n\t\n\x02\x03\x02\x12\x03\n\0\x19\n4\n\x02\x04\0\x12\x04\r\0J\
791    \x01\x1a(\x20Protocol\x20buffer\x20representing\x20a\x20tensor.\n\n\n\n\
792    \x03\x04\0\x01\x12\x03\r\x08\x13\n\x0b\n\x04\x04\0\x02\0\x12\x03\x0e\x02\
793    \x15\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x0e\x02\n\n\x0c\n\x05\x04\0\x02\
794    \0\x01\x12\x03\x0e\x0b\x10\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x0e\x13\
795    \x14\nM\n\x04\x04\0\x02\x01\x12\x03\x11\x02$\x1a@\x20Shape\x20of\x20the\
796    \x20tensor.\x20\x20TODO(touts):\x20sort\x20out\x20the\x200-rank\x20issue\
797    s.\n\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03\x11\x02\x12\n\x0c\n\x05\x04\0\
798    \x02\x01\x01\x12\x03\x11\x13\x1f\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\
799    \x11\"#\n\xc9\x03\n\x04\x04\0\x02\x02\x12\x03\x1c\x02\x1b\x1a\xd7\x01\
800    \x20Version\x20number.\n\n\x20In\x20version\x200,\x20if\x20the\x20\"repe\
801    ated\x20xxx\"\x20representations\x20contain\x20only\x20one\n\x20element,\
802    \x20that\x20element\x20is\x20repeated\x20to\x20fill\x20the\x20shape.\x20\
803    \x20This\x20makes\x20it\x20easy\n\x20to\x20represent\x20a\x20constant\
804    \x20Tensor\x20with\x20a\x20single\x20value.\n2\xe1\x01\x20Only\x20one\
805    \x20of\x20the\x20representations\x20below\x20is\x20set,\x20one\x20of\x20\
806    \"tensor_contents\"\x20and\n\x20the\x20\"xxx_val\"\x20attributes.\x20\
807    \x20We\x20are\x20not\x20using\x20oneof\x20because\x20as\x20oneofs\x20can\
808    not\n\x20contain\x20repeated\x20fields\x20it\x20would\x20require\x20anot\
809    her\x20extra\x20set\x20of\x20messages.\n\n\x0c\n\x05\x04\0\x02\x02\x05\
810    \x12\x03\x1c\x02\x07\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x1c\x08\x16\n\
811    \x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x1c\x19\x1a\n\xd8\x02\n\x04\x04\0\
812    \x02\x03\x12\x03#\x02\x1b\x1a\xca\x02\x20Serialized\x20raw\x20tensor\x20\
813    content\x20from\x20either\x20Tensor::AsProtoTensorContent\x20or\n\x20mem\
814    cpy\x20in\x20tensorflow::grpc::EncodeTensorToByteBuffer.\x20This\x20repr\
815    esentation\n\x20can\x20be\x20used\x20for\x20all\x20tensor\x20types.\x20T\
816    he\x20purpose\x20of\x20this\x20representation\x20is\x20to\n\x20reduce\
817    \x20serialization\x20overhead\x20during\x20RPC\x20call\x20by\x20avoiding\
818    \x20serialization\x20of\n\x20many\x20repeated\x20small\x20items.\n\n\x0c\
819    \n\x05\x04\0\x02\x03\x05\x12\x03#\x02\x07\n\x0c\n\x05\x04\0\x02\x03\x01\
820    \x12\x03#\x08\x16\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03#\x19\x1a\n\xef\
821    \x02\n\x04\x04\0\x02\x04\x12\x03,\x02/\x1as\x20DT_HALF.\x20Note\x20that\
822    \x20since\x20protobuf\x20has\x20no\x20int16\x20type,\x20we'll\x20have\
823    \x20some\n\x20pointless\x20zero\x20padding\x20for\x20each\x20value\x20he\
824    re.\n2\xec\x01\x20Type\x20specific\x20representations\x20that\x20make\
825    \x20it\x20easy\x20to\x20create\x20tensor\x20protos\x20in\n\x20all\x20lan\
826    guages.\x20\x20Only\x20the\x20representation\x20corresponding\x20to\x20\
827    \"dtype\"\x20can\n\x20be\x20set.\x20\x20The\x20values\x20hold\x20the\x20\
828    flattened\x20representation\x20of\x20the\x20tensor\x20in\n\x20row\x20maj\
829    or\x20order.\n\n\x0c\n\x05\x04\0\x02\x04\x04\x12\x03,\x02\n\n\x0c\n\x05\
830    \x04\0\x02\x04\x05\x12\x03,\x0b\x10\n\x0c\n\x05\x04\0\x02\x04\x01\x12\
831    \x03,\x11\x19\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03,\x1c\x1e\n\x0c\n\x05\
832    \x04\0\x02\x04\x08\x12\x03,\x1f.\n\r\n\x06\x04\0\x02\x04\x08\x02\x12\x03\
833    ,\x20-\n\x18\n\x04\x04\0\x02\x05\x12\x03/\x02/\x1a\x0b\x20DT_FLOAT.\n\n\
834    \x0c\n\x05\x04\0\x02\x05\x04\x12\x03/\x02\n\n\x0c\n\x05\x04\0\x02\x05\
835    \x05\x12\x03/\x0b\x10\n\x0c\n\x05\x04\0\x02\x05\x01\x12\x03/\x11\x1a\n\
836    \x0c\n\x05\x04\0\x02\x05\x03\x12\x03/\x1d\x1e\n\x0c\n\x05\x04\0\x02\x05\
837    \x08\x12\x03/\x1f.\n\r\n\x06\x04\0\x02\x05\x08\x02\x12\x03/\x20-\n\x19\n\
838    \x04\x04\0\x02\x06\x12\x032\x021\x1a\x0c\x20DT_DOUBLE.\n\n\x0c\n\x05\x04\
839    \0\x02\x06\x04\x12\x032\x02\n\n\x0c\n\x05\x04\0\x02\x06\x05\x12\x032\x0b\
840    \x11\n\x0c\n\x05\x04\0\x02\x06\x01\x12\x032\x12\x1c\n\x0c\n\x05\x04\0\
841    \x02\x06\x03\x12\x032\x1f\x20\n\x0c\n\x05\x04\0\x02\x06\x08\x12\x032!0\n\
842    \r\n\x06\x04\0\x02\x06\x08\x02\x12\x032\"/\n5\n\x04\x04\0\x02\x07\x12\
843    \x035\x02-\x1a(\x20DT_INT32,\x20DT_INT16,\x20DT_INT8,\x20DT_UINT8.\n\n\
844    \x0c\n\x05\x04\0\x02\x07\x04\x12\x035\x02\n\n\x0c\n\x05\x04\0\x02\x07\
845    \x05\x12\x035\x0b\x10\n\x0c\n\x05\x04\0\x02\x07\x01\x12\x035\x11\x18\n\
846    \x0c\n\x05\x04\0\x02\x07\x03\x12\x035\x1b\x1c\n\x0c\n\x05\x04\0\x02\x07\
847    \x08\x12\x035\x1d,\n\r\n\x06\x04\0\x02\x07\x08\x02\x12\x035\x1e+\n\x18\n\
848    \x04\x04\0\x02\x08\x12\x038\x02\x20\x1a\x0b\x20DT_STRING\n\n\x0c\n\x05\
849    \x04\0\x02\x08\x04\x12\x038\x02\n\n\x0c\n\x05\x04\0\x02\x08\x05\x12\x038\
850    \x0b\x10\n\x0c\n\x05\x04\0\x02\x08\x01\x12\x038\x11\x1b\n\x0c\n\x05\x04\
851    \0\x02\x08\x03\x12\x038\x1e\x1f\n\x86\x01\n\x04\x04\0\x02\t\x12\x03<\x02\
852    2\x1ay\x20DT_COMPLEX64.\x20scomplex_val(2*i)\x20and\x20scomplex_val(2*i+\
853    1)\x20are\x20real\n\x20and\x20imaginary\x20parts\x20of\x20i-th\x20single\
854    \x20precision\x20complex.\n\n\x0c\n\x05\x04\0\x02\t\x04\x12\x03<\x02\n\n\
855    \x0c\n\x05\x04\0\x02\t\x05\x12\x03<\x0b\x10\n\x0c\n\x05\x04\0\x02\t\x01\
856    \x12\x03<\x11\x1d\n\x0c\n\x05\x04\0\x02\t\x03\x12\x03<\x20!\n\x0c\n\x05\
857    \x04\0\x02\t\x08\x12\x03<\"1\n\r\n\x06\x04\0\x02\t\x08\x02\x12\x03<#0\n\
858    \x17\n\x04\x04\0\x02\n\x12\x03?\x020\x1a\n\x20DT_INT64\n\n\x0c\n\x05\x04\
859    \0\x02\n\x04\x12\x03?\x02\n\n\x0c\n\x05\x04\0\x02\n\x05\x12\x03?\x0b\x10\
860    \n\x0c\n\x05\x04\0\x02\n\x01\x12\x03?\x11\x1a\n\x0c\n\x05\x04\0\x02\n\
861    \x03\x12\x03?\x1d\x1f\n\x0c\n\x05\x04\0\x02\n\x08\x12\x03?\x20/\n\r\n\
862    \x06\x04\0\x02\n\x08\x02\x12\x03?!.\n\x16\n\x04\x04\0\x02\x0b\x12\x03B\
863    \x02.\x1a\t\x20DT_BOOL\n\n\x0c\n\x05\x04\0\x02\x0b\x04\x12\x03B\x02\n\n\
864    \x0c\n\x05\x04\0\x02\x0b\x05\x12\x03B\x0b\x0f\n\x0c\n\x05\x04\0\x02\x0b\
865    \x01\x12\x03B\x10\x18\n\x0c\n\x05\x04\0\x02\x0b\x03\x12\x03B\x1b\x1d\n\
866    \x0c\n\x05\x04\0\x02\x0b\x08\x12\x03B\x1e-\n\r\n\x06\x04\0\x02\x0b\x08\
867    \x02\x12\x03B\x1f,\n\x87\x01\n\x04\x04\0\x02\x0c\x12\x03F\x024\x1az\x20D\
868    T_COMPLEX128.\x20dcomplex_val(2*i)\x20and\x20dcomplex_val(2*i+1)\x20are\
869    \x20real\n\x20and\x20imaginary\x20parts\x20of\x20i-th\x20double\x20preci\
870    sion\x20complex.\n\n\x0c\n\x05\x04\0\x02\x0c\x04\x12\x03F\x02\n\n\x0c\n\
871    \x05\x04\0\x02\x0c\x05\x12\x03F\x0b\x11\n\x0c\n\x05\x04\0\x02\x0c\x01\
872    \x12\x03F\x12\x1e\n\x0c\n\x05\x04\0\x02\x0c\x03\x12\x03F!#\n\x0c\n\x05\
873    \x04\0\x02\x0c\x08\x12\x03F$3\n\r\n\x06\x04\0\x02\x0c\x08\x02\x12\x03F%2\
874    \n\x1a\n\x04\x04\0\x02\r\x12\x03I\x028\x1a\r\x20DT_RESOURCE\n\n\x0c\n\
875    \x05\x04\0\x02\r\x04\x12\x03I\x02\n\n\x0c\n\x05\x04\0\x02\r\x06\x12\x03I\
876    \x0b\x1e\n\x0c\n\x05\x04\0\x02\r\x01\x12\x03I\x1f2\n\x0c\n\x05\x04\0\x02\
877    \r\x03\x12\x03I57b\x06proto3\
878";
879
880static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
881
882fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
883    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
884}
885
886pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
887    file_descriptor_proto_lazy.get(|| {
888        parse_descriptor_proto()
889    })
890}