1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: tensorflow/core/protobuf/remote_tensor_handle.proto
3
4#include "tensorflow/core/protobuf/remote_tensor_handle.pb.h"
5
6#include <algorithm>
7
8#include <google/protobuf/stubs/common.h>
9#include <google/protobuf/io/coded_stream.h>
10#include <google/protobuf/extension_set.h>
11#include <google/protobuf/wire_format_lite.h>
12#include <google/protobuf/descriptor.h>
13#include <google/protobuf/generated_message_reflection.h>
14#include <google/protobuf/reflection_ops.h>
15#include <google/protobuf/wire_format.h>
16// @@protoc_insertion_point(includes)
17#include <google/protobuf/port_def.inc>
18extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto;
19extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ResourceDtypeAndShape_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto;
20namespace tensorflow {
21namespace eager {
22class ResourceDtypeAndShapeDefaultTypeInternal {
23 public:
24 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ResourceDtypeAndShape> _instance;
25} _ResourceDtypeAndShape_default_instance_;
26class RemoteTensorHandleDefaultTypeInternal {
27 public:
28 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<RemoteTensorHandle> _instance;
29} _RemoteTensorHandle_default_instance_;
30} // namespace eager
31} // namespace tensorflow
32static void InitDefaultsscc_info_RemoteTensorHandle_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto() {
33 GOOGLE_PROTOBUF_VERIFY_VERSION;
34
35 {
36 void* ptr = &::tensorflow::eager::_RemoteTensorHandle_default_instance_;
37 new (ptr) ::tensorflow::eager::RemoteTensorHandle();
38 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
39 }
40 ::tensorflow::eager::RemoteTensorHandle::InitAsDefaultInstance();
41}
42
43::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_RemoteTensorHandle_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto =
44 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_RemoteTensorHandle_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto}, {
45 &scc_info_ResourceDtypeAndShape_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto.base,}};
46
47static void InitDefaultsscc_info_ResourceDtypeAndShape_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto() {
48 GOOGLE_PROTOBUF_VERIFY_VERSION;
49
50 {
51 void* ptr = &::tensorflow::eager::_ResourceDtypeAndShape_default_instance_;
52 new (ptr) ::tensorflow::eager::ResourceDtypeAndShape();
53 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
54 }
55 ::tensorflow::eager::ResourceDtypeAndShape::InitAsDefaultInstance();
56}
57
58::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ResourceDtypeAndShape_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto =
59 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_ResourceDtypeAndShape_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto}, {
60 &scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto.base,}};
61
62static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto[2];
63static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto = nullptr;
64static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto = nullptr;
65
66const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
67 ~0u, // no _has_bits_
68 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::ResourceDtypeAndShape, _internal_metadata_),
69 ~0u, // no _extensions_
70 ~0u, // no _oneof_case_
71 ~0u, // no _weak_field_map_
72 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::ResourceDtypeAndShape, dtype_),
73 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::ResourceDtypeAndShape, shape_),
74 ~0u, // no _has_bits_
75 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::RemoteTensorHandle, _internal_metadata_),
76 ~0u, // no _extensions_
77 ~0u, // no _oneof_case_
78 ~0u, // no _weak_field_map_
79 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::RemoteTensorHandle, op_id_),
80 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::RemoteTensorHandle, output_num_),
81 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::RemoteTensorHandle, device_),
82 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::RemoteTensorHandle, op_device_),
83 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::RemoteTensorHandle, dtype_),
84 PROTOBUF_FIELD_OFFSET(::tensorflow::eager::RemoteTensorHandle, resource_dtypes_and_shapes_),
85};
86static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
87 { 0, -1, sizeof(::tensorflow::eager::ResourceDtypeAndShape)},
88 { 7, -1, sizeof(::tensorflow::eager::RemoteTensorHandle)},
89};
90
91static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
92 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::eager::_ResourceDtypeAndShape_default_instance_),
93 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::eager::_RemoteTensorHandle_default_instance_),
94};
95
96const char descriptor_table_protodef_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
97 "\n3tensorflow/core/protobuf/remote_tensor"
98 "_handle.proto\022\020tensorflow.eager\032,tensorf"
99 "low/core/framework/tensor_shape.proto\032%t"
100 "ensorflow/core/framework/types.proto\"i\n\025"
101 "ResourceDtypeAndShape\022#\n\005dtype\030\001 \001(\0162\024.t"
102 "ensorflow.DataType\022+\n\005shape\030\002 \001(\0132\034.tens"
103 "orflow.TensorShapeProto\"\314\001\n\022RemoteTensor"
104 "Handle\022\r\n\005op_id\030\001 \001(\003\022\022\n\noutput_num\030\002 \001("
105 "\005\022\016\n\006device\030\003 \001(\t\022\021\n\top_device\030\004 \001(\t\022#\n\005"
106 "dtype\030\005 \001(\0162\024.tensorflow.DataType\022K\n\032res"
107 "ource_dtypes_and_shapes\030\006 \003(\0132\'.tensorfl"
108 "ow.eager.ResourceDtypeAndShapeB\220\001\n\030org.t"
109 "ensorflow.frameworkB\030RemoteTensorHandleP"
110 "rotosP\001ZUgithub.com/tensorflow/tensorflo"
111 "w/tensorflow/go/core/protobuf/for_core_p"
112 "rotos_go_proto\370\001\001b\006proto3"
113 ;
114static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto_deps[2] = {
115 &::descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto,
116 &::descriptor_table_tensorflow_2fcore_2fframework_2ftypes_2eproto,
117};
118static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto_sccs[2] = {
119 &scc_info_RemoteTensorHandle_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto.base,
120 &scc_info_ResourceDtypeAndShape_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto.base,
121};
122static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto_once;
123static bool descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto_initialized = false;
124const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto = {
125 &descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto, "tensorflow/core/protobuf/remote_tensor_handle.proto", 625,
126 &descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto_once, descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto_deps, 2, 2,
127 schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto::offsets,
128 file_level_metadata_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto, 2, file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto,
129};
130
131// Force running AddDescriptors() at dynamic initialization time.
132static bool dynamic_init_dummy_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto), true);
133namespace tensorflow {
134namespace eager {
135
136// ===================================================================
137
138void ResourceDtypeAndShape::InitAsDefaultInstance() {
139 ::tensorflow::eager::_ResourceDtypeAndShape_default_instance_._instance.get_mutable()->shape_ = const_cast< ::tensorflow::TensorShapeProto*>(
140 ::tensorflow::TensorShapeProto::internal_default_instance());
141}
142class ResourceDtypeAndShape::_Internal {
143 public:
144 static const ::tensorflow::TensorShapeProto& shape(const ResourceDtypeAndShape* msg);
145};
146
147const ::tensorflow::TensorShapeProto&
148ResourceDtypeAndShape::_Internal::shape(const ResourceDtypeAndShape* msg) {
149 return *msg->shape_;
150}
151void ResourceDtypeAndShape::unsafe_arena_set_allocated_shape(
152 ::tensorflow::TensorShapeProto* shape) {
153 if (GetArenaNoVirtual() == nullptr) {
154 delete shape_;
155 }
156 shape_ = shape;
157 if (shape) {
158
159 } else {
160
161 }
162 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.eager.ResourceDtypeAndShape.shape)
163}
164void ResourceDtypeAndShape::clear_shape() {
165 if (GetArenaNoVirtual() == nullptr && shape_ != nullptr) {
166 delete shape_;
167 }
168 shape_ = nullptr;
169}
170ResourceDtypeAndShape::ResourceDtypeAndShape()
171 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
172 SharedCtor();
173 // @@protoc_insertion_point(constructor:tensorflow.eager.ResourceDtypeAndShape)
174}
175ResourceDtypeAndShape::ResourceDtypeAndShape(::PROTOBUF_NAMESPACE_ID::Arena* arena)
176 : ::PROTOBUF_NAMESPACE_ID::Message(),
177 _internal_metadata_(arena) {
178 SharedCtor();
179 RegisterArenaDtor(arena);
180 // @@protoc_insertion_point(arena_constructor:tensorflow.eager.ResourceDtypeAndShape)
181}
182ResourceDtypeAndShape::ResourceDtypeAndShape(const ResourceDtypeAndShape& from)
183 : ::PROTOBUF_NAMESPACE_ID::Message(),
184 _internal_metadata_(nullptr) {
185 _internal_metadata_.MergeFrom(from._internal_metadata_);
186 if (from.has_shape()) {
187 shape_ = new ::tensorflow::TensorShapeProto(*from.shape_);
188 } else {
189 shape_ = nullptr;
190 }
191 dtype_ = from.dtype_;
192 // @@protoc_insertion_point(copy_constructor:tensorflow.eager.ResourceDtypeAndShape)
193}
194
195void ResourceDtypeAndShape::SharedCtor() {
196 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ResourceDtypeAndShape_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto.base);
197 ::memset(&shape_, 0, static_cast<size_t>(
198 reinterpret_cast<char*>(&dtype_) -
199 reinterpret_cast<char*>(&shape_)) + sizeof(dtype_));
200}
201
202ResourceDtypeAndShape::~ResourceDtypeAndShape() {
203 // @@protoc_insertion_point(destructor:tensorflow.eager.ResourceDtypeAndShape)
204 SharedDtor();
205}
206
207void ResourceDtypeAndShape::SharedDtor() {
208 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
209 if (this != internal_default_instance()) delete shape_;
210}
211
212void ResourceDtypeAndShape::ArenaDtor(void* object) {
213 ResourceDtypeAndShape* _this = reinterpret_cast< ResourceDtypeAndShape* >(object);
214 (void)_this;
215}
216void ResourceDtypeAndShape::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
217}
218void ResourceDtypeAndShape::SetCachedSize(int size) const {
219 _cached_size_.Set(size);
220}
221const ResourceDtypeAndShape& ResourceDtypeAndShape::default_instance() {
222 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ResourceDtypeAndShape_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto.base);
223 return *internal_default_instance();
224}
225
226
227void ResourceDtypeAndShape::Clear() {
228// @@protoc_insertion_point(message_clear_start:tensorflow.eager.ResourceDtypeAndShape)
229 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
230 // Prevent compiler warnings about cached_has_bits being unused
231 (void) cached_has_bits;
232
233 if (GetArenaNoVirtual() == nullptr && shape_ != nullptr) {
234 delete shape_;
235 }
236 shape_ = nullptr;
237 dtype_ = 0;
238 _internal_metadata_.Clear();
239}
240
241#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
242const char* ResourceDtypeAndShape::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
243#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
244 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
245 while (!ctx->Done(&ptr)) {
246 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
247 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
248 CHK_(ptr);
249 switch (tag >> 3) {
250 // .tensorflow.DataType dtype = 1;
251 case 1:
252 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
253 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
254 CHK_(ptr);
255 set_dtype(static_cast<::tensorflow::DataType>(val));
256 } else goto handle_unusual;
257 continue;
258 // .tensorflow.TensorShapeProto shape = 2;
259 case 2:
260 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
261 ptr = ctx->ParseMessage(mutable_shape(), ptr);
262 CHK_(ptr);
263 } else goto handle_unusual;
264 continue;
265 default: {
266 handle_unusual:
267 if ((tag & 7) == 4 || tag == 0) {
268 ctx->SetLastTag(tag);
269 goto success;
270 }
271 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
272 CHK_(ptr != nullptr);
273 continue;
274 }
275 } // switch
276 } // while
277success:
278 return ptr;
279failure:
280 ptr = nullptr;
281 goto success;
282#undef CHK_
283}
284#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
285bool ResourceDtypeAndShape::MergePartialFromCodedStream(
286 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
287#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
288 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
289 // @@protoc_insertion_point(parse_start:tensorflow.eager.ResourceDtypeAndShape)
290 for (;;) {
291 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
292 tag = p.first;
293 if (!p.second) goto handle_unusual;
294 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
295 // .tensorflow.DataType dtype = 1;
296 case 1: {
297 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
298 int value = 0;
299 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
300 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
301 input, &value)));
302 set_dtype(static_cast< ::tensorflow::DataType >(value));
303 } else {
304 goto handle_unusual;
305 }
306 break;
307 }
308
309 // .tensorflow.TensorShapeProto shape = 2;
310 case 2: {
311 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
312 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
313 input, mutable_shape()));
314 } else {
315 goto handle_unusual;
316 }
317 break;
318 }
319
320 default: {
321 handle_unusual:
322 if (tag == 0) {
323 goto success;
324 }
325 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
326 input, tag, _internal_metadata_.mutable_unknown_fields()));
327 break;
328 }
329 }
330 }
331success:
332 // @@protoc_insertion_point(parse_success:tensorflow.eager.ResourceDtypeAndShape)
333 return true;
334failure:
335 // @@protoc_insertion_point(parse_failure:tensorflow.eager.ResourceDtypeAndShape)
336 return false;
337#undef DO_
338}
339#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
340
341void ResourceDtypeAndShape::SerializeWithCachedSizes(
342 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
343 // @@protoc_insertion_point(serialize_start:tensorflow.eager.ResourceDtypeAndShape)
344 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
345 (void) cached_has_bits;
346
347 // .tensorflow.DataType dtype = 1;
348 if (this->dtype() != 0) {
349 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
350 1, this->dtype(), output);
351 }
352
353 // .tensorflow.TensorShapeProto shape = 2;
354 if (this->has_shape()) {
355 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
356 2, _Internal::shape(this), output);
357 }
358
359 if (_internal_metadata_.have_unknown_fields()) {
360 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
361 _internal_metadata_.unknown_fields(), output);
362 }
363 // @@protoc_insertion_point(serialize_end:tensorflow.eager.ResourceDtypeAndShape)
364}
365
366::PROTOBUF_NAMESPACE_ID::uint8* ResourceDtypeAndShape::InternalSerializeWithCachedSizesToArray(
367 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
368 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.eager.ResourceDtypeAndShape)
369 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
370 (void) cached_has_bits;
371
372 // .tensorflow.DataType dtype = 1;
373 if (this->dtype() != 0) {
374 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
375 1, this->dtype(), target);
376 }
377
378 // .tensorflow.TensorShapeProto shape = 2;
379 if (this->has_shape()) {
380 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
381 InternalWriteMessageToArray(
382 2, _Internal::shape(this), target);
383 }
384
385 if (_internal_metadata_.have_unknown_fields()) {
386 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
387 _internal_metadata_.unknown_fields(), target);
388 }
389 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.eager.ResourceDtypeAndShape)
390 return target;
391}
392
393size_t ResourceDtypeAndShape::ByteSizeLong() const {
394// @@protoc_insertion_point(message_byte_size_start:tensorflow.eager.ResourceDtypeAndShape)
395 size_t total_size = 0;
396
397 if (_internal_metadata_.have_unknown_fields()) {
398 total_size +=
399 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
400 _internal_metadata_.unknown_fields());
401 }
402 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
403 // Prevent compiler warnings about cached_has_bits being unused
404 (void) cached_has_bits;
405
406 // .tensorflow.TensorShapeProto shape = 2;
407 if (this->has_shape()) {
408 total_size += 1 +
409 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
410 *shape_);
411 }
412
413 // .tensorflow.DataType dtype = 1;
414 if (this->dtype() != 0) {
415 total_size += 1 +
416 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->dtype());
417 }
418
419 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
420 SetCachedSize(cached_size);
421 return total_size;
422}
423
424void ResourceDtypeAndShape::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
425// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.eager.ResourceDtypeAndShape)
426 GOOGLE_DCHECK_NE(&from, this);
427 const ResourceDtypeAndShape* source =
428 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ResourceDtypeAndShape>(
429 &from);
430 if (source == nullptr) {
431 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.eager.ResourceDtypeAndShape)
432 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
433 } else {
434 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.eager.ResourceDtypeAndShape)
435 MergeFrom(*source);
436 }
437}
438
439void ResourceDtypeAndShape::MergeFrom(const ResourceDtypeAndShape& from) {
440// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.eager.ResourceDtypeAndShape)
441 GOOGLE_DCHECK_NE(&from, this);
442 _internal_metadata_.MergeFrom(from._internal_metadata_);
443 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
444 (void) cached_has_bits;
445
446 if (from.has_shape()) {
447 mutable_shape()->::tensorflow::TensorShapeProto::MergeFrom(from.shape());
448 }
449 if (from.dtype() != 0) {
450 set_dtype(from.dtype());
451 }
452}
453
454void ResourceDtypeAndShape::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
455// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.eager.ResourceDtypeAndShape)
456 if (&from == this) return;
457 Clear();
458 MergeFrom(from);
459}
460
461void ResourceDtypeAndShape::CopyFrom(const ResourceDtypeAndShape& from) {
462// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.eager.ResourceDtypeAndShape)
463 if (&from == this) return;
464 Clear();
465 MergeFrom(from);
466}
467
468bool ResourceDtypeAndShape::IsInitialized() const {
469 return true;
470}
471
472void ResourceDtypeAndShape::InternalSwap(ResourceDtypeAndShape* other) {
473 using std::swap;
474 _internal_metadata_.Swap(&other->_internal_metadata_);
475 swap(shape_, other->shape_);
476 swap(dtype_, other->dtype_);
477}
478
479::PROTOBUF_NAMESPACE_ID::Metadata ResourceDtypeAndShape::GetMetadata() const {
480 return GetMetadataStatic();
481}
482
483
484// ===================================================================
485
486void RemoteTensorHandle::InitAsDefaultInstance() {
487}
488class RemoteTensorHandle::_Internal {
489 public:
490};
491
492RemoteTensorHandle::RemoteTensorHandle()
493 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
494 SharedCtor();
495 // @@protoc_insertion_point(constructor:tensorflow.eager.RemoteTensorHandle)
496}
497RemoteTensorHandle::RemoteTensorHandle(::PROTOBUF_NAMESPACE_ID::Arena* arena)
498 : ::PROTOBUF_NAMESPACE_ID::Message(),
499 _internal_metadata_(arena),
500 resource_dtypes_and_shapes_(arena) {
501 SharedCtor();
502 RegisterArenaDtor(arena);
503 // @@protoc_insertion_point(arena_constructor:tensorflow.eager.RemoteTensorHandle)
504}
505RemoteTensorHandle::RemoteTensorHandle(const RemoteTensorHandle& from)
506 : ::PROTOBUF_NAMESPACE_ID::Message(),
507 _internal_metadata_(nullptr),
508 resource_dtypes_and_shapes_(from.resource_dtypes_and_shapes_) {
509 _internal_metadata_.MergeFrom(from._internal_metadata_);
510 device_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
511 if (!from.device().empty()) {
512 device_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.device(),
513 GetArenaNoVirtual());
514 }
515 op_device_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
516 if (!from.op_device().empty()) {
517 op_device_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.op_device(),
518 GetArenaNoVirtual());
519 }
520 ::memcpy(&op_id_, &from.op_id_,
521 static_cast<size_t>(reinterpret_cast<char*>(&dtype_) -
522 reinterpret_cast<char*>(&op_id_)) + sizeof(dtype_));
523 // @@protoc_insertion_point(copy_constructor:tensorflow.eager.RemoteTensorHandle)
524}
525
526void RemoteTensorHandle::SharedCtor() {
527 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RemoteTensorHandle_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto.base);
528 device_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
529 op_device_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
530 ::memset(&op_id_, 0, static_cast<size_t>(
531 reinterpret_cast<char*>(&dtype_) -
532 reinterpret_cast<char*>(&op_id_)) + sizeof(dtype_));
533}
534
535RemoteTensorHandle::~RemoteTensorHandle() {
536 // @@protoc_insertion_point(destructor:tensorflow.eager.RemoteTensorHandle)
537 SharedDtor();
538}
539
540void RemoteTensorHandle::SharedDtor() {
541 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
542 device_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
543 op_device_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
544}
545
546void RemoteTensorHandle::ArenaDtor(void* object) {
547 RemoteTensorHandle* _this = reinterpret_cast< RemoteTensorHandle* >(object);
548 (void)_this;
549}
550void RemoteTensorHandle::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
551}
552void RemoteTensorHandle::SetCachedSize(int size) const {
553 _cached_size_.Set(size);
554}
555const RemoteTensorHandle& RemoteTensorHandle::default_instance() {
556 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RemoteTensorHandle_tensorflow_2fcore_2fprotobuf_2fremote_5ftensor_5fhandle_2eproto.base);
557 return *internal_default_instance();
558}
559
560
561void RemoteTensorHandle::Clear() {
562// @@protoc_insertion_point(message_clear_start:tensorflow.eager.RemoteTensorHandle)
563 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
564 // Prevent compiler warnings about cached_has_bits being unused
565 (void) cached_has_bits;
566
567 resource_dtypes_and_shapes_.Clear();
568 device_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
569 op_device_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
570 ::memset(&op_id_, 0, static_cast<size_t>(
571 reinterpret_cast<char*>(&dtype_) -
572 reinterpret_cast<char*>(&op_id_)) + sizeof(dtype_));
573 _internal_metadata_.Clear();
574}
575
576#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
577const char* RemoteTensorHandle::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
578#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
579 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
580 while (!ctx->Done(&ptr)) {
581 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
582 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
583 CHK_(ptr);
584 switch (tag >> 3) {
585 // int64 op_id = 1;
586 case 1:
587 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
588 op_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
589 CHK_(ptr);
590 } else goto handle_unusual;
591 continue;
592 // int32 output_num = 2;
593 case 2:
594 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
595 output_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
596 CHK_(ptr);
597 } else goto handle_unusual;
598 continue;
599 // string device = 3;
600 case 3:
601 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
602 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_device(), ptr, ctx, "tensorflow.eager.RemoteTensorHandle.device");
603 CHK_(ptr);
604 } else goto handle_unusual;
605 continue;
606 // string op_device = 4;
607 case 4:
608 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
609 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_op_device(), ptr, ctx, "tensorflow.eager.RemoteTensorHandle.op_device");
610 CHK_(ptr);
611 } else goto handle_unusual;
612 continue;
613 // .tensorflow.DataType dtype = 5;
614 case 5:
615 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
616 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
617 CHK_(ptr);
618 set_dtype(static_cast<::tensorflow::DataType>(val));
619 } else goto handle_unusual;
620 continue;
621 // repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6;
622 case 6:
623 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
624 ptr -= 1;
625 do {
626 ptr += 1;
627 ptr = ctx->ParseMessage(add_resource_dtypes_and_shapes(), ptr);
628 CHK_(ptr);
629 if (!ctx->DataAvailable(ptr)) break;
630 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50);
631 } else goto handle_unusual;
632 continue;
633 default: {
634 handle_unusual:
635 if ((tag & 7) == 4 || tag == 0) {
636 ctx->SetLastTag(tag);
637 goto success;
638 }
639 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
640 CHK_(ptr != nullptr);
641 continue;
642 }
643 } // switch
644 } // while
645success:
646 return ptr;
647failure:
648 ptr = nullptr;
649 goto success;
650#undef CHK_
651}
652#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
653bool RemoteTensorHandle::MergePartialFromCodedStream(
654 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
655#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
656 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
657 // @@protoc_insertion_point(parse_start:tensorflow.eager.RemoteTensorHandle)
658 for (;;) {
659 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
660 tag = p.first;
661 if (!p.second) goto handle_unusual;
662 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
663 // int64 op_id = 1;
664 case 1: {
665 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
666
667 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
668 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
669 input, &op_id_)));
670 } else {
671 goto handle_unusual;
672 }
673 break;
674 }
675
676 // int32 output_num = 2;
677 case 2: {
678 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
679
680 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
681 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
682 input, &output_num_)));
683 } else {
684 goto handle_unusual;
685 }
686 break;
687 }
688
689 // string device = 3;
690 case 3: {
691 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
692 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
693 input, this->mutable_device()));
694 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
695 this->device().data(), static_cast<int>(this->device().length()),
696 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
697 "tensorflow.eager.RemoteTensorHandle.device"));
698 } else {
699 goto handle_unusual;
700 }
701 break;
702 }
703
704 // string op_device = 4;
705 case 4: {
706 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
707 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
708 input, this->mutable_op_device()));
709 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
710 this->op_device().data(), static_cast<int>(this->op_device().length()),
711 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
712 "tensorflow.eager.RemoteTensorHandle.op_device"));
713 } else {
714 goto handle_unusual;
715 }
716 break;
717 }
718
719 // .tensorflow.DataType dtype = 5;
720 case 5: {
721 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
722 int value = 0;
723 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
724 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
725 input, &value)));
726 set_dtype(static_cast< ::tensorflow::DataType >(value));
727 } else {
728 goto handle_unusual;
729 }
730 break;
731 }
732
733 // repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6;
734 case 6: {
735 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
736 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
737 input, add_resource_dtypes_and_shapes()));
738 } else {
739 goto handle_unusual;
740 }
741 break;
742 }
743
744 default: {
745 handle_unusual:
746 if (tag == 0) {
747 goto success;
748 }
749 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
750 input, tag, _internal_metadata_.mutable_unknown_fields()));
751 break;
752 }
753 }
754 }
755success:
756 // @@protoc_insertion_point(parse_success:tensorflow.eager.RemoteTensorHandle)
757 return true;
758failure:
759 // @@protoc_insertion_point(parse_failure:tensorflow.eager.RemoteTensorHandle)
760 return false;
761#undef DO_
762}
763#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
764
765void RemoteTensorHandle::SerializeWithCachedSizes(
766 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
767 // @@protoc_insertion_point(serialize_start:tensorflow.eager.RemoteTensorHandle)
768 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
769 (void) cached_has_bits;
770
771 // int64 op_id = 1;
772 if (this->op_id() != 0) {
773 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->op_id(), output);
774 }
775
776 // int32 output_num = 2;
777 if (this->output_num() != 0) {
778 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(2, this->output_num(), output);
779 }
780
781 // string device = 3;
782 if (this->device().size() > 0) {
783 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
784 this->device().data(), static_cast<int>(this->device().length()),
785 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
786 "tensorflow.eager.RemoteTensorHandle.device");
787 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
788 3, this->device(), output);
789 }
790
791 // string op_device = 4;
792 if (this->op_device().size() > 0) {
793 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
794 this->op_device().data(), static_cast<int>(this->op_device().length()),
795 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
796 "tensorflow.eager.RemoteTensorHandle.op_device");
797 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
798 4, this->op_device(), output);
799 }
800
801 // .tensorflow.DataType dtype = 5;
802 if (this->dtype() != 0) {
803 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
804 5, this->dtype(), output);
805 }
806
807 // repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6;
808 for (unsigned int i = 0,
809 n = static_cast<unsigned int>(this->resource_dtypes_and_shapes_size()); i < n; i++) {
810 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
811 6,
812 this->resource_dtypes_and_shapes(static_cast<int>(i)),
813 output);
814 }
815
816 if (_internal_metadata_.have_unknown_fields()) {
817 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
818 _internal_metadata_.unknown_fields(), output);
819 }
820 // @@protoc_insertion_point(serialize_end:tensorflow.eager.RemoteTensorHandle)
821}
822
823::PROTOBUF_NAMESPACE_ID::uint8* RemoteTensorHandle::InternalSerializeWithCachedSizesToArray(
824 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
825 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.eager.RemoteTensorHandle)
826 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
827 (void) cached_has_bits;
828
829 // int64 op_id = 1;
830 if (this->op_id() != 0) {
831 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->op_id(), target);
832 }
833
834 // int32 output_num = 2;
835 if (this->output_num() != 0) {
836 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->output_num(), target);
837 }
838
839 // string device = 3;
840 if (this->device().size() > 0) {
841 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
842 this->device().data(), static_cast<int>(this->device().length()),
843 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
844 "tensorflow.eager.RemoteTensorHandle.device");
845 target =
846 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
847 3, this->device(), target);
848 }
849
850 // string op_device = 4;
851 if (this->op_device().size() > 0) {
852 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
853 this->op_device().data(), static_cast<int>(this->op_device().length()),
854 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
855 "tensorflow.eager.RemoteTensorHandle.op_device");
856 target =
857 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
858 4, this->op_device(), target);
859 }
860
861 // .tensorflow.DataType dtype = 5;
862 if (this->dtype() != 0) {
863 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
864 5, this->dtype(), target);
865 }
866
867 // repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6;
868 for (unsigned int i = 0,
869 n = static_cast<unsigned int>(this->resource_dtypes_and_shapes_size()); i < n; i++) {
870 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
871 InternalWriteMessageToArray(
872 6, this->resource_dtypes_and_shapes(static_cast<int>(i)), target);
873 }
874
875 if (_internal_metadata_.have_unknown_fields()) {
876 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
877 _internal_metadata_.unknown_fields(), target);
878 }
879 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.eager.RemoteTensorHandle)
880 return target;
881}
882
883size_t RemoteTensorHandle::ByteSizeLong() const {
884// @@protoc_insertion_point(message_byte_size_start:tensorflow.eager.RemoteTensorHandle)
885 size_t total_size = 0;
886
887 if (_internal_metadata_.have_unknown_fields()) {
888 total_size +=
889 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
890 _internal_metadata_.unknown_fields());
891 }
892 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
893 // Prevent compiler warnings about cached_has_bits being unused
894 (void) cached_has_bits;
895
896 // repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6;
897 {
898 unsigned int count = static_cast<unsigned int>(this->resource_dtypes_and_shapes_size());
899 total_size += 1UL * count;
900 for (unsigned int i = 0; i < count; i++) {
901 total_size +=
902 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
903 this->resource_dtypes_and_shapes(static_cast<int>(i)));
904 }
905 }
906
907 // string device = 3;
908 if (this->device().size() > 0) {
909 total_size += 1 +
910 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
911 this->device());
912 }
913
914 // string op_device = 4;
915 if (this->op_device().size() > 0) {
916 total_size += 1 +
917 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
918 this->op_device());
919 }
920
921 // int64 op_id = 1;
922 if (this->op_id() != 0) {
923 total_size += 1 +
924 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
925 this->op_id());
926 }
927
928 // int32 output_num = 2;
929 if (this->output_num() != 0) {
930 total_size += 1 +
931 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
932 this->output_num());
933 }
934
935 // .tensorflow.DataType dtype = 5;
936 if (this->dtype() != 0) {
937 total_size += 1 +
938 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->dtype());
939 }
940
941 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
942 SetCachedSize(cached_size);
943 return total_size;
944}
945
946void RemoteTensorHandle::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
947// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.eager.RemoteTensorHandle)
948 GOOGLE_DCHECK_NE(&from, this);
949 const RemoteTensorHandle* source =
950 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<RemoteTensorHandle>(
951 &from);
952 if (source == nullptr) {
953 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.eager.RemoteTensorHandle)
954 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
955 } else {
956 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.eager.RemoteTensorHandle)
957 MergeFrom(*source);
958 }
959}
960
961void RemoteTensorHandle::MergeFrom(const RemoteTensorHandle& from) {
962// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.eager.RemoteTensorHandle)
963 GOOGLE_DCHECK_NE(&from, this);
964 _internal_metadata_.MergeFrom(from._internal_metadata_);
965 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
966 (void) cached_has_bits;
967
968 resource_dtypes_and_shapes_.MergeFrom(from.resource_dtypes_and_shapes_);
969 if (from.device().size() > 0) {
970 set_device(from.device());
971 }
972 if (from.op_device().size() > 0) {
973 set_op_device(from.op_device());
974 }
975 if (from.op_id() != 0) {
976 set_op_id(from.op_id());
977 }
978 if (from.output_num() != 0) {
979 set_output_num(from.output_num());
980 }
981 if (from.dtype() != 0) {
982 set_dtype(from.dtype());
983 }
984}
985
986void RemoteTensorHandle::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
987// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.eager.RemoteTensorHandle)
988 if (&from == this) return;
989 Clear();
990 MergeFrom(from);
991}
992
993void RemoteTensorHandle::CopyFrom(const RemoteTensorHandle& from) {
994// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.eager.RemoteTensorHandle)
995 if (&from == this) return;
996 Clear();
997 MergeFrom(from);
998}
999
1000bool RemoteTensorHandle::IsInitialized() const {
1001 return true;
1002}
1003
1004void RemoteTensorHandle::InternalSwap(RemoteTensorHandle* other) {
1005 using std::swap;
1006 _internal_metadata_.Swap(&other->_internal_metadata_);
1007 CastToBase(&resource_dtypes_and_shapes_)->InternalSwap(CastToBase(&other->resource_dtypes_and_shapes_));
1008 device_.Swap(&other->device_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1009 GetArenaNoVirtual());
1010 op_device_.Swap(&other->op_device_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1011 GetArenaNoVirtual());
1012 swap(op_id_, other->op_id_);
1013 swap(output_num_, other->output_num_);
1014 swap(dtype_, other->dtype_);
1015}
1016
1017::PROTOBUF_NAMESPACE_ID::Metadata RemoteTensorHandle::GetMetadata() const {
1018 return GetMetadataStatic();
1019}
1020
1021
1022// @@protoc_insertion_point(namespace_scope)
1023} // namespace eager
1024} // namespace tensorflow
1025PROTOBUF_NAMESPACE_OPEN
1026template<> PROTOBUF_NOINLINE ::tensorflow::eager::ResourceDtypeAndShape* Arena::CreateMaybeMessage< ::tensorflow::eager::ResourceDtypeAndShape >(Arena* arena) {
1027 return Arena::CreateMessageInternal< ::tensorflow::eager::ResourceDtypeAndShape >(arena);
1028}
1029template<> PROTOBUF_NOINLINE ::tensorflow::eager::RemoteTensorHandle* Arena::CreateMaybeMessage< ::tensorflow::eager::RemoteTensorHandle >(Arena* arena) {
1030 return Arena::CreateMessageInternal< ::tensorflow::eager::RemoteTensorHandle >(arena);
1031}
1032PROTOBUF_NAMESPACE_CLOSE
1033
1034// @@protoc_insertion_point(global_scope)
1035#include <google/protobuf/port_undef.inc>
1036