tensorflow_serving_client/
graph.rs

1// This file is generated by rust-protobuf 2.14.0. 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#![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)]
20//! Generated file from `tensorflow/core/framework/graph.proto`
21
22use protobuf::Message as Message_imported_for_functions;
23use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
24
25/// Generated files are compatible only with the same version
26/// of protobuf runtime.
27// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_14_0;
28
29#[derive(PartialEq,Clone,Default)]
30pub struct GraphDef {
31    // message fields
32    pub node: ::protobuf::RepeatedField<super::node_def::NodeDef>,
33    pub versions: ::protobuf::SingularPtrField<super::versions::VersionDef>,
34    pub version: i32,
35    pub library: ::protobuf::SingularPtrField<super::function::FunctionDefLibrary>,
36    // special fields
37    pub unknown_fields: ::protobuf::UnknownFields,
38    pub cached_size: ::protobuf::CachedSize,
39}
40
41impl<'a> ::std::default::Default for &'a GraphDef {
42    fn default() -> &'a GraphDef {
43        <GraphDef as ::protobuf::Message>::default_instance()
44    }
45}
46
47impl GraphDef {
48    pub fn new() -> GraphDef {
49        ::std::default::Default::default()
50    }
51
52    // repeated .tensorflow.NodeDef node = 1;
53
54
55    pub fn get_node(&self) -> &[super::node_def::NodeDef] {
56        &self.node
57    }
58    pub fn clear_node(&mut self) {
59        self.node.clear();
60    }
61
62    // Param is passed by value, moved
63    pub fn set_node(&mut self, v: ::protobuf::RepeatedField<super::node_def::NodeDef>) {
64        self.node = v;
65    }
66
67    // Mutable pointer to the field.
68    pub fn mut_node(&mut self) -> &mut ::protobuf::RepeatedField<super::node_def::NodeDef> {
69        &mut self.node
70    }
71
72    // Take field
73    pub fn take_node(&mut self) -> ::protobuf::RepeatedField<super::node_def::NodeDef> {
74        ::std::mem::replace(&mut self.node, ::protobuf::RepeatedField::new())
75    }
76
77    // .tensorflow.VersionDef versions = 4;
78
79
80    pub fn get_versions(&self) -> &super::versions::VersionDef {
81        self.versions.as_ref().unwrap_or_else(|| super::versions::VersionDef::default_instance())
82    }
83    pub fn clear_versions(&mut self) {
84        self.versions.clear();
85    }
86
87    pub fn has_versions(&self) -> bool {
88        self.versions.is_some()
89    }
90
91    // Param is passed by value, moved
92    pub fn set_versions(&mut self, v: super::versions::VersionDef) {
93        self.versions = ::protobuf::SingularPtrField::some(v);
94    }
95
96    // Mutable pointer to the field.
97    // If field is not initialized, it is initialized with default value first.
98    pub fn mut_versions(&mut self) -> &mut super::versions::VersionDef {
99        if self.versions.is_none() {
100            self.versions.set_default();
101        }
102        self.versions.as_mut().unwrap()
103    }
104
105    // Take field
106    pub fn take_versions(&mut self) -> super::versions::VersionDef {
107        self.versions.take().unwrap_or_else(|| super::versions::VersionDef::new())
108    }
109
110    // int32 version = 3;
111
112
113    pub fn get_version(&self) -> i32 {
114        self.version
115    }
116    pub fn clear_version(&mut self) {
117        self.version = 0;
118    }
119
120    // Param is passed by value, moved
121    pub fn set_version(&mut self, v: i32) {
122        self.version = v;
123    }
124
125    // .tensorflow.FunctionDefLibrary library = 2;
126
127
128    pub fn get_library(&self) -> &super::function::FunctionDefLibrary {
129        self.library.as_ref().unwrap_or_else(|| super::function::FunctionDefLibrary::default_instance())
130    }
131    pub fn clear_library(&mut self) {
132        self.library.clear();
133    }
134
135    pub fn has_library(&self) -> bool {
136        self.library.is_some()
137    }
138
139    // Param is passed by value, moved
140    pub fn set_library(&mut self, v: super::function::FunctionDefLibrary) {
141        self.library = ::protobuf::SingularPtrField::some(v);
142    }
143
144    // Mutable pointer to the field.
145    // If field is not initialized, it is initialized with default value first.
146    pub fn mut_library(&mut self) -> &mut super::function::FunctionDefLibrary {
147        if self.library.is_none() {
148            self.library.set_default();
149        }
150        self.library.as_mut().unwrap()
151    }
152
153    // Take field
154    pub fn take_library(&mut self) -> super::function::FunctionDefLibrary {
155        self.library.take().unwrap_or_else(|| super::function::FunctionDefLibrary::new())
156    }
157}
158
159impl ::protobuf::Message for GraphDef {
160    fn is_initialized(&self) -> bool {
161        for v in &self.node {
162            if !v.is_initialized() {
163                return false;
164            }
165        };
166        for v in &self.versions {
167            if !v.is_initialized() {
168                return false;
169            }
170        };
171        for v in &self.library {
172            if !v.is_initialized() {
173                return false;
174            }
175        };
176        true
177    }
178
179    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
180        while !is.eof()? {
181            let (field_number, wire_type) = is.read_tag_unpack()?;
182            match field_number {
183                1 => {
184                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.node)?;
185                },
186                4 => {
187                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.versions)?;
188                },
189                3 => {
190                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
191                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
192                    }
193                    let tmp = is.read_int32()?;
194                    self.version = tmp;
195                },
196                2 => {
197                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.library)?;
198                },
199                _ => {
200                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
201                },
202            };
203        }
204        ::std::result::Result::Ok(())
205    }
206
207    // Compute sizes of nested messages
208    #[allow(unused_variables)]
209    fn compute_size(&self) -> u32 {
210        let mut my_size = 0;
211        for value in &self.node {
212            let len = value.compute_size();
213            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
214        };
215        if let Some(ref v) = self.versions.as_ref() {
216            let len = v.compute_size();
217            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
218        }
219        if self.version != 0 {
220            my_size += ::protobuf::rt::value_size(3, self.version, ::protobuf::wire_format::WireTypeVarint);
221        }
222        if let Some(ref v) = self.library.as_ref() {
223            let len = v.compute_size();
224            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
225        }
226        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
227        self.cached_size.set(my_size);
228        my_size
229    }
230
231    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
232        for v in &self.node {
233            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
234            os.write_raw_varint32(v.get_cached_size())?;
235            v.write_to_with_cached_sizes(os)?;
236        };
237        if let Some(ref v) = self.versions.as_ref() {
238            os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?;
239            os.write_raw_varint32(v.get_cached_size())?;
240            v.write_to_with_cached_sizes(os)?;
241        }
242        if self.version != 0 {
243            os.write_int32(3, self.version)?;
244        }
245        if let Some(ref v) = self.library.as_ref() {
246            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
247            os.write_raw_varint32(v.get_cached_size())?;
248            v.write_to_with_cached_sizes(os)?;
249        }
250        os.write_unknown_fields(self.get_unknown_fields())?;
251        ::std::result::Result::Ok(())
252    }
253
254    fn get_cached_size(&self) -> u32 {
255        self.cached_size.get()
256    }
257
258    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
259        &self.unknown_fields
260    }
261
262    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
263        &mut self.unknown_fields
264    }
265
266    fn as_any(&self) -> &dyn (::std::any::Any) {
267        self as &dyn (::std::any::Any)
268    }
269    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
270        self as &mut dyn (::std::any::Any)
271    }
272    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
273        self
274    }
275
276    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
277        Self::descriptor_static()
278    }
279
280    fn new() -> GraphDef {
281        GraphDef::new()
282    }
283
284    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
285        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
286        unsafe {
287            descriptor.get(|| {
288                let mut fields = ::std::vec::Vec::new();
289                fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::node_def::NodeDef>>(
290                    "node",
291                    |m: &GraphDef| { &m.node },
292                    |m: &mut GraphDef| { &mut m.node },
293                ));
294                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::versions::VersionDef>>(
295                    "versions",
296                    |m: &GraphDef| { &m.versions },
297                    |m: &mut GraphDef| { &mut m.versions },
298                ));
299                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
300                    "version",
301                    |m: &GraphDef| { &m.version },
302                    |m: &mut GraphDef| { &mut m.version },
303                ));
304                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::function::FunctionDefLibrary>>(
305                    "library",
306                    |m: &GraphDef| { &m.library },
307                    |m: &mut GraphDef| { &mut m.library },
308                ));
309                ::protobuf::reflect::MessageDescriptor::new_pb_name::<GraphDef>(
310                    "GraphDef",
311                    fields,
312                    file_descriptor_proto()
313                )
314            })
315        }
316    }
317
318    fn default_instance() -> &'static GraphDef {
319        static mut instance: ::protobuf::lazy::Lazy<GraphDef> = ::protobuf::lazy::Lazy::INIT;
320        unsafe {
321            instance.get(GraphDef::new)
322        }
323    }
324}
325
326impl ::protobuf::Clear for GraphDef {
327    fn clear(&mut self) {
328        self.node.clear();
329        self.versions.clear();
330        self.version = 0;
331        self.library.clear();
332        self.unknown_fields.clear();
333    }
334}
335
336impl ::std::fmt::Debug for GraphDef {
337    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
338        ::protobuf::text_format::fmt(self, f)
339    }
340}
341
342impl ::protobuf::reflect::ProtobufValue for GraphDef {
343    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
344        ::protobuf::reflect::ReflectValueRef::Message(self)
345    }
346}
347
348static file_descriptor_proto_data: &'static [u8] = b"\
349    \n%tensorflow/core/framework/graph.proto\x12\ntensorflow\x1a(tensorflow/\
350    core/framework/function.proto\x1a(tensorflow/core/framework/node_def.pro\
351    to\x1a(tensorflow/core/framework/versions.proto\"\xbf\x01\n\x08GraphDef\
352    \x12'\n\x04node\x18\x01\x20\x03(\x0b2\x13.tensorflow.NodeDefR\x04node\
353    \x122\n\x08versions\x18\x04\x20\x01(\x0b2\x16.tensorflow.VersionDefR\x08\
354    versions\x12\x1c\n\x07version\x18\x03\x20\x01(\x05R\x07versionB\x02\x18\
355    \x01\x128\n\x07library\x18\x02\x20\x01(\x0b2\x1e.tensorflow.FunctionDefL\
356    ibraryR\x07libraryBz\n\x18org.tensorflow.frameworkB\x0bGraphProtosP\x01Z\
357    Lgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/graph_go_\
358    proto\xf8\x01\x01J\xc4\x0f\n\x06\x12\x04\0\09\x01\n\x08\n\x01\x0c\x12\
359    \x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x02\0\x13\n\t\n\x02\x03\0\x12\x03\
360    \x04\02\n\t\n\x02\x03\x01\x12\x03\x05\02\n\t\n\x02\x03\x02\x12\x03\x06\0\
361    2\n\x08\n\x01\x08\x12\x03\x08\0\x1f\n\t\n\x02\x08\x1f\x12\x03\x08\0\x1f\
362    \n\x08\n\x01\x08\x12\x03\t\0,\n\t\n\x02\x08\x08\x12\x03\t\0,\n\x08\n\x01\
363    \x08\x12\x03\n\0\"\n\t\n\x02\x08\n\x12\x03\n\0\"\n\x08\n\x01\x08\x12\x03\
364    \x0b\01\n\t\n\x02\x08\x01\x12\x03\x0b\01\n\x08\n\x01\x08\x12\x03\x0c\0c\
365    \n\t\n\x02\x08\x0b\x12\x03\x0c\0c\n0\n\x02\x04\0\x12\x04\x0f\09\x01\x1a$\
366    \x20Represents\x20the\x20graph\x20of\x20operations\n\n\n\n\x03\x04\0\x01\
367    \x12\x03\x0f\x08\x10\n\x0b\n\x04\x04\0\x02\0\x12\x03\x10\x02\x1c\n\x0c\n\
368    \x05\x04\0\x02\0\x04\x12\x03\x10\x02\n\n\x0c\n\x05\x04\0\x02\0\x06\x12\
369    \x03\x10\x0b\x12\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x10\x13\x17\n\x0c\n\
370    \x05\x04\0\x02\0\x03\x12\x03\x10\x1a\x1b\n\xef\x01\n\x04\x04\0\x02\x01\
371    \x12\x03\x15\x02\x1a\x1a\xe1\x01\x20Compatibility\x20versions\x20of\x20t\
372    he\x20graph.\x20\x20See\x20core/public/version.h\x20for\x20version\n\x20\
373    history.\x20\x20The\x20GraphDef\x20version\x20is\x20distinct\x20from\x20\
374    the\x20TensorFlow\x20version,\x20and\n\x20each\x20release\x20of\x20Tenso\
375    rFlow\x20will\x20support\x20a\x20range\x20of\x20GraphDef\x20versions.\n\
376    \n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03\x15\x02\x0c\n\x0c\n\x05\x04\0\x02\
377    \x01\x01\x12\x03\x15\r\x15\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x15\x18\
378    \x19\n\xc4\x01\n\x04\x04\0\x02\x02\x12\x03\x1a\x02(\x1a\xb6\x01\x20Depre\
379    cated\x20single\x20version\x20field;\x20use\x20versions\x20above\x20inst\
380    ead.\x20\x20Since\x20all\n\x20GraphDef\x20changes\x20before\x20\"version\
381    s\"\x20was\x20introduced\x20were\x20forward\n\x20compatible,\x20this\x20\
382    field\x20is\x20entirely\x20ignored.\n\n\x0c\n\x05\x04\0\x02\x02\x05\x12\
383    \x03\x1a\x02\x07\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x1a\x08\x0f\n\x0c\
384    \n\x05\x04\0\x02\x02\x03\x12\x03\x1a\x12\x13\n\x0c\n\x05\x04\0\x02\x02\
385    \x08\x12\x03\x1a\x14'\n\r\n\x06\x04\0\x02\x02\x08\x03\x12\x03\x1a\x15&\n\
386    \xc4\x08\n\x04\x04\0\x02\x03\x12\x038\x02!\x1a\xb6\x08\x20EXPERIMENTAL.\
387    \x20DO\x20NOT\x20USE\x20OR\x20DEPEND\x20ON\x20THIS\x20YET.\n\n\x20\"libr\
388    ary\"\x20provides\x20user-defined\x20functions.\n\n\x20Naming:\n\x20\x20\
389    \x20*\x20library.function.name\x20are\x20in\x20a\x20flat\x20namespace.\n\
390    \x20\x20\x20\x20\x20NOTE:\x20We\x20may\x20need\x20to\x20change\x20it\x20\
391    to\x20be\x20hierarchical\x20to\x20support\n\x20\x20\x20\x20\x20different\
392    \x20orgs.\x20E.g.,\n\x20\x20\x20\x20\x20{\x20\"/google/nn\",\x20{\x20...\
393    \x20}},\n\x20\x20\x20\x20\x20{\x20\"/google/vision\",\x20{\x20...\x20}}\
394    \n\x20\x20\x20\x20\x20{\x20\"/org_foo/module_bar\",\x20{\x20...\x20}}\n\
395    \x20\x20\x20\x20\x20map<string,\x20FunctionDefLib>\x20named_lib;\n\x20\
396    \x20\x20*\x20If\x20node[i].op\x20is\x20the\x20name\x20of\x20one\x20funct\
397    ion\x20in\x20\"library\",\n\x20\x20\x20\x20\x20node[i]\x20is\x20deemed\
398    \x20as\x20a\x20function\x20call.\x20Otherwise,\x20node[i].op\n\x20\x20\
399    \x20\x20\x20must\x20be\x20a\x20primitive\x20operation\x20supported\x20by\
400    \x20the\x20runtime.\n\n\n\x20Function\x20call\x20semantics:\n\n\x20\x20\
401    \x20*\x20The\x20callee\x20may\x20start\x20execution\x20as\x20soon\x20as\
402    \x20some\x20of\x20its\x20inputs\n\x20\x20\x20\x20\x20are\x20ready.\x20Th\
403    e\x20caller\x20may\x20want\x20to\x20use\x20Tuple()\x20mechanism\x20to\n\
404    \x20\x20\x20\x20\x20ensure\x20all\x20inputs\x20are\x20ready\x20in\x20the\
405    \x20same\x20time.\n\n\x20\x20\x20*\x20The\x20consumer\x20of\x20return\
406    \x20values\x20may\x20start\x20executing\x20as\x20soon\x20as\n\x20\x20\
407    \x20\x20\x20the\x20return\x20values\x20the\x20consumer\x20depends\x20on\
408    \x20are\x20ready.\x20\x20The\n\x20\x20\x20\x20\x20consumer\x20may\x20wan\
409    t\x20to\x20use\x20Tuple()\x20mechanism\x20to\x20ensure\x20the\n\x20\x20\
410    \x20\x20\x20consumer\x20does\x20not\x20start\x20until\x20all\x20return\
411    \x20values\x20of\x20the\x20callee\n\x20\x20\x20\x20\x20function\x20are\
412    \x20ready.\n\n\x0c\n\x05\x04\0\x02\x03\x06\x12\x038\x02\x14\n\x0c\n\x05\
413    \x04\0\x02\x03\x01\x12\x038\x15\x1c\n\x0c\n\x05\x04\0\x02\x03\x03\x12\
414    \x038\x1f\x20b\x06proto3\
415";
416
417static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
418
419fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
420    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
421}
422
423pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
424    unsafe {
425        file_descriptor_proto_lazy.get(|| {
426            parse_descriptor_proto()
427        })
428    }
429}