tensorflow/protos/
allocation_description.rs1#![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#[derive(PartialEq,Clone,Default)]
27pub struct AllocationDescription {
28 pub requested_bytes: i64,
30 pub allocated_bytes: i64,
31 pub allocator_name: ::std::string::String,
32 pub allocation_id: i64,
33 pub has_single_reference: bool,
34 pub ptr: u64,
35 pub unknown_fields: ::protobuf::UnknownFields,
37 pub cached_size: ::protobuf::CachedSize,
38}
39
40impl<'a> ::std::default::Default for &'a AllocationDescription {
41 fn default() -> &'a AllocationDescription {
42 <AllocationDescription as ::protobuf::Message>::default_instance()
43 }
44}
45
46impl AllocationDescription {
47 pub fn new() -> AllocationDescription {
48 ::std::default::Default::default()
49 }
50
51 pub fn get_requested_bytes(&self) -> i64 {
55 self.requested_bytes
56 }
57 pub fn clear_requested_bytes(&mut self) {
58 self.requested_bytes = 0;
59 }
60
61 pub fn set_requested_bytes(&mut self, v: i64) {
63 self.requested_bytes = v;
64 }
65
66 pub fn get_allocated_bytes(&self) -> i64 {
70 self.allocated_bytes
71 }
72 pub fn clear_allocated_bytes(&mut self) {
73 self.allocated_bytes = 0;
74 }
75
76 pub fn set_allocated_bytes(&mut self, v: i64) {
78 self.allocated_bytes = v;
79 }
80
81 pub fn get_allocator_name(&self) -> &str {
85 &self.allocator_name
86 }
87 pub fn clear_allocator_name(&mut self) {
88 self.allocator_name.clear();
89 }
90
91 pub fn set_allocator_name(&mut self, v: ::std::string::String) {
93 self.allocator_name = v;
94 }
95
96 pub fn mut_allocator_name(&mut self) -> &mut ::std::string::String {
99 &mut self.allocator_name
100 }
101
102 pub fn take_allocator_name(&mut self) -> ::std::string::String {
104 ::std::mem::replace(&mut self.allocator_name, ::std::string::String::new())
105 }
106
107 pub fn get_allocation_id(&self) -> i64 {
111 self.allocation_id
112 }
113 pub fn clear_allocation_id(&mut self) {
114 self.allocation_id = 0;
115 }
116
117 pub fn set_allocation_id(&mut self, v: i64) {
119 self.allocation_id = v;
120 }
121
122 pub fn get_has_single_reference(&self) -> bool {
126 self.has_single_reference
127 }
128 pub fn clear_has_single_reference(&mut self) {
129 self.has_single_reference = false;
130 }
131
132 pub fn set_has_single_reference(&mut self, v: bool) {
134 self.has_single_reference = v;
135 }
136
137 pub fn get_ptr(&self) -> u64 {
141 self.ptr
142 }
143 pub fn clear_ptr(&mut self) {
144 self.ptr = 0;
145 }
146
147 pub fn set_ptr(&mut self, v: u64) {
149 self.ptr = v;
150 }
151}
152
153impl ::protobuf::Message for AllocationDescription {
154 fn is_initialized(&self) -> bool {
155 true
156 }
157
158 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
159 while !is.eof()? {
160 let (field_number, wire_type) = is.read_tag_unpack()?;
161 match field_number {
162 1 => {
163 if wire_type != ::protobuf::wire_format::WireTypeVarint {
164 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
165 }
166 let tmp = is.read_int64()?;
167 self.requested_bytes = tmp;
168 },
169 2 => {
170 if wire_type != ::protobuf::wire_format::WireTypeVarint {
171 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
172 }
173 let tmp = is.read_int64()?;
174 self.allocated_bytes = tmp;
175 },
176 3 => {
177 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.allocator_name)?;
178 },
179 4 => {
180 if wire_type != ::protobuf::wire_format::WireTypeVarint {
181 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
182 }
183 let tmp = is.read_int64()?;
184 self.allocation_id = tmp;
185 },
186 5 => {
187 if wire_type != ::protobuf::wire_format::WireTypeVarint {
188 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
189 }
190 let tmp = is.read_bool()?;
191 self.has_single_reference = tmp;
192 },
193 6 => {
194 if wire_type != ::protobuf::wire_format::WireTypeVarint {
195 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
196 }
197 let tmp = is.read_uint64()?;
198 self.ptr = tmp;
199 },
200 _ => {
201 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
202 },
203 };
204 }
205 ::std::result::Result::Ok(())
206 }
207
208 #[allow(unused_variables)]
210 fn compute_size(&self) -> u32 {
211 let mut my_size = 0;
212 if self.requested_bytes != 0 {
213 my_size += ::protobuf::rt::value_size(1, self.requested_bytes, ::protobuf::wire_format::WireTypeVarint);
214 }
215 if self.allocated_bytes != 0 {
216 my_size += ::protobuf::rt::value_size(2, self.allocated_bytes, ::protobuf::wire_format::WireTypeVarint);
217 }
218 if !self.allocator_name.is_empty() {
219 my_size += ::protobuf::rt::string_size(3, &self.allocator_name);
220 }
221 if self.allocation_id != 0 {
222 my_size += ::protobuf::rt::value_size(4, self.allocation_id, ::protobuf::wire_format::WireTypeVarint);
223 }
224 if self.has_single_reference != false {
225 my_size += 2;
226 }
227 if self.ptr != 0 {
228 my_size += ::protobuf::rt::value_size(6, self.ptr, ::protobuf::wire_format::WireTypeVarint);
229 }
230 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
231 self.cached_size.set(my_size);
232 my_size
233 }
234
235 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
236 if self.requested_bytes != 0 {
237 os.write_int64(1, self.requested_bytes)?;
238 }
239 if self.allocated_bytes != 0 {
240 os.write_int64(2, self.allocated_bytes)?;
241 }
242 if !self.allocator_name.is_empty() {
243 os.write_string(3, &self.allocator_name)?;
244 }
245 if self.allocation_id != 0 {
246 os.write_int64(4, self.allocation_id)?;
247 }
248 if self.has_single_reference != false {
249 os.write_bool(5, self.has_single_reference)?;
250 }
251 if self.ptr != 0 {
252 os.write_uint64(6, self.ptr)?;
253 }
254 os.write_unknown_fields(self.get_unknown_fields())?;
255 ::std::result::Result::Ok(())
256 }
257
258 fn get_cached_size(&self) -> u32 {
259 self.cached_size.get()
260 }
261
262 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
263 &self.unknown_fields
264 }
265
266 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
267 &mut self.unknown_fields
268 }
269
270 fn as_any(&self) -> &dyn (::std::any::Any) {
271 self as &dyn (::std::any::Any)
272 }
273 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
274 self as &mut dyn (::std::any::Any)
275 }
276 fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
277 self
278 }
279
280 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
281 Self::descriptor_static()
282 }
283
284 fn new() -> AllocationDescription {
285 AllocationDescription::new()
286 }
287
288 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
289 static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
290 descriptor.get(|| {
291 let mut fields = ::std::vec::Vec::new();
292 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
293 "requested_bytes",
294 |m: &AllocationDescription| { &m.requested_bytes },
295 |m: &mut AllocationDescription| { &mut m.requested_bytes },
296 ));
297 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
298 "allocated_bytes",
299 |m: &AllocationDescription| { &m.allocated_bytes },
300 |m: &mut AllocationDescription| { &mut m.allocated_bytes },
301 ));
302 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
303 "allocator_name",
304 |m: &AllocationDescription| { &m.allocator_name },
305 |m: &mut AllocationDescription| { &mut m.allocator_name },
306 ));
307 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
308 "allocation_id",
309 |m: &AllocationDescription| { &m.allocation_id },
310 |m: &mut AllocationDescription| { &mut m.allocation_id },
311 ));
312 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
313 "has_single_reference",
314 |m: &AllocationDescription| { &m.has_single_reference },
315 |m: &mut AllocationDescription| { &mut m.has_single_reference },
316 ));
317 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
318 "ptr",
319 |m: &AllocationDescription| { &m.ptr },
320 |m: &mut AllocationDescription| { &mut m.ptr },
321 ));
322 ::protobuf::reflect::MessageDescriptor::new_pb_name::<AllocationDescription>(
323 "AllocationDescription",
324 fields,
325 file_descriptor_proto()
326 )
327 })
328 }
329
330 fn default_instance() -> &'static AllocationDescription {
331 static instance: ::protobuf::rt::LazyV2<AllocationDescription> = ::protobuf::rt::LazyV2::INIT;
332 instance.get(AllocationDescription::new)
333 }
334}
335
336impl ::protobuf::Clear for AllocationDescription {
337 fn clear(&mut self) {
338 self.requested_bytes = 0;
339 self.allocated_bytes = 0;
340 self.allocator_name.clear();
341 self.allocation_id = 0;
342 self.has_single_reference = false;
343 self.ptr = 0;
344 self.unknown_fields.clear();
345 }
346}
347
348impl ::std::fmt::Debug for AllocationDescription {
349 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
350 ::protobuf::text_format::fmt(self, f)
351 }
352}
353
354impl ::protobuf::reflect::ProtobufValue for AllocationDescription {
355 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
356 ::protobuf::reflect::ReflectValueRef::Message(self)
357 }
358}
359
360static file_descriptor_proto_data: &'static [u8] = b"\
361 \n6tensorflow/core/framework/allocation_description.proto\x12\ntensorflo\
362 w\"\xf9\x01\n\x15AllocationDescription\x12'\n\x0frequested_bytes\x18\x01\
363 \x20\x01(\x03R\x0erequestedBytes\x12'\n\x0fallocated_bytes\x18\x02\x20\
364 \x01(\x03R\x0eallocatedBytes\x12%\n\x0eallocator_name\x18\x03\x20\x01(\t\
365 R\rallocatorName\x12#\n\rallocation_id\x18\x04\x20\x01(\x03R\x0callocati\
366 onId\x120\n\x14has_single_reference\x18\x05\x20\x01(\x08R\x12hasSingleRe\
367 ference\x12\x10\n\x03ptr\x18\x06\x20\x01(\x04R\x03ptrB\x9b\x01\n\x18org.\
368 tensorflow.frameworkB\x1bAllocationDescriptionProtosP\x01Z]github.com/te\
369 nsorflow/tensorflow/tensorflow/go/core/framework/allocation_description_\
370 go_proto\xf8\x01\x01b\x06proto3\
371";
372
373static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
374
375fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
376 ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
377}
378
379pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
380 file_descriptor_proto_lazy.get(|| {
381 parse_descriptor_proto()
382 })
383}