This repository was archived by the owner on Feb 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 149
/
Copy pathresource_handle.pb.swift
111 lines (95 loc) · 4.34 KB
/
resource_handle.pb.swift
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
// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: resource_handle.proto
//
// For information on using the generated types, please see the documentation:
// https://github.com/apple/swift-protobuf/
import Foundation
import SwiftProtobuf
// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that you are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}
/// Protocol buffer representing a handle to a tensorflow resource. Handles are
/// not valid across executions, but can be serialized back and forth from within
/// a single run.
struct TensorboardX_ResourceHandleProto {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// Unique name for the device containing the resource.
var device: String = String()
/// Container in which this resource is placed.
var container: String = String()
/// Unique name of this resource.
var name: String = String()
/// Hash code for the type of the resource. Is only valid in the same device
/// and in the same execution.
var hashCode: UInt64 = 0
/// For debug-only, the name of the type pointed to by this handle, if
/// available.
var maybeTypeName: String = String()
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
// MARK: - Code below here is support for the SwiftProtobuf runtime.
fileprivate let _protobuf_package = "tensorboardX"
extension TensorboardX_ResourceHandleProto: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".ResourceHandleProto"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "device"),
2: .same(proto: "container"),
3: .same(proto: "name"),
4: .standard(proto: "hash_code"),
5: .standard(proto: "maybe_type_name"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularStringField(value: &self.device) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.container) }()
case 3: try { try decoder.decodeSingularStringField(value: &self.name) }()
case 4: try { try decoder.decodeSingularUInt64Field(value: &self.hashCode) }()
case 5: try { try decoder.decodeSingularStringField(value: &self.maybeTypeName) }()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.device.isEmpty {
try visitor.visitSingularStringField(value: self.device, fieldNumber: 1)
}
if !self.container.isEmpty {
try visitor.visitSingularStringField(value: self.container, fieldNumber: 2)
}
if !self.name.isEmpty {
try visitor.visitSingularStringField(value: self.name, fieldNumber: 3)
}
if self.hashCode != 0 {
try visitor.visitSingularUInt64Field(value: self.hashCode, fieldNumber: 4)
}
if !self.maybeTypeName.isEmpty {
try visitor.visitSingularStringField(value: self.maybeTypeName, fieldNumber: 5)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: TensorboardX_ResourceHandleProto, rhs: TensorboardX_ResourceHandleProto) -> Bool {
if lhs.device != rhs.device {return false}
if lhs.container != rhs.container {return false}
if lhs.name != rhs.name {return false}
if lhs.hashCode != rhs.hashCode {return false}
if lhs.maybeTypeName != rhs.maybeTypeName {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}