1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
// This file is generated by rust-protobuf 3.2.0. Do not edit
// .proto file is parsed by pure
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
#![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_results)]
#![allow(unused_mut)]

//! Generated file from `tensorflow/core/framework/node_def.proto`

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0;

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:tensorflow.NodeDef)
pub struct NodeDef {
    // message fields
    // @@protoc_insertion_point(field:tensorflow.NodeDef.name)
    pub name: ::std::string::String,
    // @@protoc_insertion_point(field:tensorflow.NodeDef.op)
    pub op: ::std::string::String,
    // @@protoc_insertion_point(field:tensorflow.NodeDef.input)
    pub input: ::std::vec::Vec<::std::string::String>,
    // @@protoc_insertion_point(field:tensorflow.NodeDef.device)
    pub device: ::std::string::String,
    // @@protoc_insertion_point(field:tensorflow.NodeDef.attr)
    pub attr: ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue>,
    // @@protoc_insertion_point(field:tensorflow.NodeDef.experimental_debug_info)
    pub experimental_debug_info: ::protobuf::MessageField<node_def::ExperimentalDebugInfo>,
    // @@protoc_insertion_point(field:tensorflow.NodeDef.experimental_type)
    pub experimental_type: ::protobuf::MessageField<super::full_type::FullTypeDef>,
    // special fields
    // @@protoc_insertion_point(special_field:tensorflow.NodeDef.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

impl<'a> ::std::default::Default for &'a NodeDef {
    fn default() -> &'a NodeDef {
        <NodeDef as ::protobuf::Message>::default_instance()
    }
}

impl NodeDef {
    pub fn new() -> NodeDef {
        ::std::default::Default::default()
    }

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(7);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
            "name",
            |m: &NodeDef| { &m.name },
            |m: &mut NodeDef| { &mut m.name },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
            "op",
            |m: &NodeDef| { &m.op },
            |m: &mut NodeDef| { &mut m.op },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
            "input",
            |m: &NodeDef| { &m.input },
            |m: &mut NodeDef| { &mut m.input },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
            "device",
            |m: &NodeDef| { &m.device },
            |m: &mut NodeDef| { &mut m.device },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_map_simpler_accessor::<_, _, _>(
            "attr",
            |m: &NodeDef| { &m.attr },
            |m: &mut NodeDef| { &mut m.attr },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, node_def::ExperimentalDebugInfo>(
            "experimental_debug_info",
            |m: &NodeDef| { &m.experimental_debug_info },
            |m: &mut NodeDef| { &mut m.experimental_debug_info },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::full_type::FullTypeDef>(
            "experimental_type",
            |m: &NodeDef| { &m.experimental_type },
            |m: &mut NodeDef| { &mut m.experimental_type },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<NodeDef>(
            "NodeDef",
            fields,
            oneofs,
        )
    }
}

impl ::protobuf::Message for NodeDef {
    const NAME: &'static str = "NodeDef";

    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    self.name = is.read_string()?;
                },
                18 => {
                    self.op = is.read_string()?;
                },
                26 => {
                    self.input.push(is.read_string()?);
                },
                34 => {
                    self.device = is.read_string()?;
                },
                42 => {
                    let len = is.read_raw_varint32()?;
                    let old_limit = is.push_limit(len as u64)?;
                    let mut key = ::std::default::Default::default();
                    let mut value = ::std::default::Default::default();
                    while let Some(tag) = is.read_raw_tag_or_eof()? {
                        match tag {
                            10 => key = is.read_string()?,
                            18 => value = is.read_message()?,
                            _ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
                        };
                    }
                    is.pop_limit(old_limit);
                    self.attr.insert(key, value);
                },
                50 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.experimental_debug_info)?;
                },
                58 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.experimental_type)?;
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if !self.name.is_empty() {
            my_size += ::protobuf::rt::string_size(1, &self.name);
        }
        if !self.op.is_empty() {
            my_size += ::protobuf::rt::string_size(2, &self.op);
        }
        for value in &self.input {
            my_size += ::protobuf::rt::string_size(3, &value);
        };
        if !self.device.is_empty() {
            my_size += ::protobuf::rt::string_size(4, &self.device);
        }
        for (k, v) in &self.attr {
            let mut entry_size = 0;
            entry_size += ::protobuf::rt::string_size(1, &k);
            let len = v.compute_size();
            entry_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
        };
        if let Some(v) = self.experimental_debug_info.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.experimental_type.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if !self.name.is_empty() {
            os.write_string(1, &self.name)?;
        }
        if !self.op.is_empty() {
            os.write_string(2, &self.op)?;
        }
        for v in &self.input {
            os.write_string(3, &v)?;
        };
        if !self.device.is_empty() {
            os.write_string(4, &self.device)?;
        }
        for (k, v) in &self.attr {
            let mut entry_size = 0;
            entry_size += ::protobuf::rt::string_size(1, &k);
            let len = v.cached_size() as u64;
            entry_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
            os.write_raw_varint32(42)?; // Tag.
            os.write_raw_varint32(entry_size as u32)?;
            os.write_string(1, &k)?;
            ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
        };
        if let Some(v) = self.experimental_debug_info.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?;
        }
        if let Some(v) = self.experimental_type.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(7, v, os)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> NodeDef {
        NodeDef::new()
    }

    fn clear(&mut self) {
        self.name.clear();
        self.op.clear();
        self.input.clear();
        self.device.clear();
        self.attr.clear();
        self.experimental_debug_info.clear();
        self.experimental_type.clear();
        self.special_fields.clear();
    }

    fn default_instance() -> &'static NodeDef {
        static instance: ::protobuf::rt::Lazy<NodeDef> = ::protobuf::rt::Lazy::new();
        instance.get(NodeDef::new)
    }
}

impl ::protobuf::MessageFull for NodeDef {
    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
        descriptor.get(|| file_descriptor().message_by_package_relative_name("NodeDef").unwrap()).clone()
    }
}

impl ::std::fmt::Display for NodeDef {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for NodeDef {
    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}

/// Nested message and enums of message `NodeDef`
pub mod node_def {
    #[derive(PartialEq,Clone,Default,Debug)]
    // @@protoc_insertion_point(message:tensorflow.NodeDef.ExperimentalDebugInfo)
    pub struct ExperimentalDebugInfo {
        // message fields
        // @@protoc_insertion_point(field:tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names)
        pub original_node_names: ::std::vec::Vec<::std::string::String>,
        // @@protoc_insertion_point(field:tensorflow.NodeDef.ExperimentalDebugInfo.original_func_names)
        pub original_func_names: ::std::vec::Vec<::std::string::String>,
        // special fields
        // @@protoc_insertion_point(special_field:tensorflow.NodeDef.ExperimentalDebugInfo.special_fields)
        pub special_fields: ::protobuf::SpecialFields,
    }

    impl<'a> ::std::default::Default for &'a ExperimentalDebugInfo {
        fn default() -> &'a ExperimentalDebugInfo {
            <ExperimentalDebugInfo as ::protobuf::Message>::default_instance()
        }
    }

    impl ExperimentalDebugInfo {
        pub fn new() -> ExperimentalDebugInfo {
            ::std::default::Default::default()
        }

        pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
            let mut fields = ::std::vec::Vec::with_capacity(2);
            let mut oneofs = ::std::vec::Vec::with_capacity(0);
            fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
                "original_node_names",
                |m: &ExperimentalDebugInfo| { &m.original_node_names },
                |m: &mut ExperimentalDebugInfo| { &mut m.original_node_names },
            ));
            fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
                "original_func_names",
                |m: &ExperimentalDebugInfo| { &m.original_func_names },
                |m: &mut ExperimentalDebugInfo| { &mut m.original_func_names },
            ));
            ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ExperimentalDebugInfo>(
                "NodeDef.ExperimentalDebugInfo",
                fields,
                oneofs,
            )
        }
    }

    impl ::protobuf::Message for ExperimentalDebugInfo {
        const NAME: &'static str = "ExperimentalDebugInfo";

        fn is_initialized(&self) -> bool {
            true
        }

        fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
            while let Some(tag) = is.read_raw_tag_or_eof()? {
                match tag {
                    10 => {
                        self.original_node_names.push(is.read_string()?);
                    },
                    18 => {
                        self.original_func_names.push(is.read_string()?);
                    },
                    tag => {
                        ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                    },
                };
            }
            ::std::result::Result::Ok(())
        }

        // Compute sizes of nested messages
        #[allow(unused_variables)]
        fn compute_size(&self) -> u64 {
            let mut my_size = 0;
            for value in &self.original_node_names {
                my_size += ::protobuf::rt::string_size(1, &value);
            };
            for value in &self.original_func_names {
                my_size += ::protobuf::rt::string_size(2, &value);
            };
            my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
            self.special_fields.cached_size().set(my_size as u32);
            my_size
        }

        fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
            for v in &self.original_node_names {
                os.write_string(1, &v)?;
            };
            for v in &self.original_func_names {
                os.write_string(2, &v)?;
            };
            os.write_unknown_fields(self.special_fields.unknown_fields())?;
            ::std::result::Result::Ok(())
        }

        fn special_fields(&self) -> &::protobuf::SpecialFields {
            &self.special_fields
        }

        fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
            &mut self.special_fields
        }

        fn new() -> ExperimentalDebugInfo {
            ExperimentalDebugInfo::new()
        }

        fn clear(&mut self) {
            self.original_node_names.clear();
            self.original_func_names.clear();
            self.special_fields.clear();
        }

        fn default_instance() -> &'static ExperimentalDebugInfo {
            static instance: ExperimentalDebugInfo = ExperimentalDebugInfo {
                original_node_names: ::std::vec::Vec::new(),
                original_func_names: ::std::vec::Vec::new(),
                special_fields: ::protobuf::SpecialFields::new(),
            };
            &instance
        }
    }

    impl ::protobuf::MessageFull for ExperimentalDebugInfo {
        fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
            static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
            descriptor.get(|| super::file_descriptor().message_by_package_relative_name("NodeDef.ExperimentalDebugInfo").unwrap()).clone()
        }
    }

    impl ::std::fmt::Display for ExperimentalDebugInfo {
        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            ::protobuf::text_format::fmt(self, f)
        }
    }

    impl ::protobuf::reflect::ProtobufValue for ExperimentalDebugInfo {
        type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
    }
}

static file_descriptor_proto_data: &'static [u8] = b"\
    \n(tensorflow/core/framework/node_def.proto\x12\ntensorflow\x1a*tensorfl\
    ow/core/framework/attr_value.proto\x1a)tensorflow/core/framework/full_ty\
    pe.proto\"\x80\x04\n\x07NodeDef\x12\x12\n\x04name\x18\x01\x20\x01(\tR\
    \x04name\x12\x0e\n\x02op\x18\x02\x20\x01(\tR\x02op\x12\x14\n\x05input\
    \x18\x03\x20\x03(\tR\x05input\x12\x16\n\x06device\x18\x04\x20\x01(\tR\
    \x06device\x121\n\x04attr\x18\x05\x20\x03(\x0b2\x1d.tensorflow.NodeDef.A\
    ttrEntryR\x04attr\x12a\n\x17experimental_debug_info\x18\x06\x20\x01(\x0b\
    2).tensorflow.NodeDef.ExperimentalDebugInfoR\x15experimentalDebugInfo\
    \x12D\n\x11experimental_type\x18\x07\x20\x01(\x0b2\x17.tensorflow.FullTy\
    peDefR\x10experimentalType\x1aN\n\tAttrEntry\x12\x10\n\x03key\x18\x01\
    \x20\x01(\tR\x03key\x12+\n\x05value\x18\x02\x20\x01(\x0b2\x15.tensorflow\
    .AttrValueR\x05value:\x028\x01\x1aw\n\x15ExperimentalDebugInfo\x12.\n\
    \x13original_node_names\x18\x01\x20\x03(\tR\x11originalNodeNames\x12.\n\
    \x13original_func_names\x18\x02\x20\x03(\tR\x11originalFuncNamesB{\n\x18\
    org.tensorflow.frameworkB\tNodeProtoP\x01ZOgithub.com/tensorflow/tensorf\
    low/tensorflow/go/core/framework/node_def_go_proto\xf8\x01\x01b\x06proto\
    3\
";

/// `FileDescriptorProto` object which was a source for this generated file
fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
    file_descriptor_proto_lazy.get(|| {
        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
    })
}

/// `FileDescriptor` object which allows dynamic access to files
pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
    file_descriptor.get(|| {
        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
            let mut deps = ::std::vec::Vec::with_capacity(2);
            deps.push(super::attr_value::file_descriptor().clone());
            deps.push(super::full_type::file_descriptor().clone());
            let mut messages = ::std::vec::Vec::with_capacity(2);
            messages.push(NodeDef::generated_message_descriptor_data());
            messages.push(node_def::ExperimentalDebugInfo::generated_message_descriptor_data());
            let mut enums = ::std::vec::Vec::with_capacity(0);
            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
                file_descriptor_proto(),
                deps,
                messages,
                enums,
            )
        });
        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
    })
}