Skip to content

Commit 51c6786

Browse files
committed
Fixing non-public issue for some of the protocol buffers. Thank you @johndpope
1 parent 26f3e2e commit 51c6786

File tree

72 files changed

+2523
-2524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2523
-2524
lines changed

PADockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
RUN cd /tmp && rm -rf tf && mkdir tf && cd tf && wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.1.0.tar.gz && tar xzvf ./libtensorflow-cpu-linux-x86_64-1.1.0.tar.gz && sudo cp ./lib/libtensorflow.so /usr/local/lib && cd .. && rm -rf tf && cd
2-
1+
RUN curl https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.1.0.tar.gz -o /tmp/tflib.tgz && rmdir -rf /tmp/tf && mkdir /tmp/tf && tar xzf /tmp/tflib.tgz -C /tmp/tf && sudo cp /tmp/tf/lib/libtensorflow.so /usr/local/lib && rm -rf /tmp/tf && rm /tmp/tflib.tgz

Sources/PerfectTensorFlow/pb.allocation_description.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ public struct Tensorflow_AllocationDescription: SwiftProtobuf.Message {
2323
public static let protoMessageName: String = _protobuf_package + ".AllocationDescription"
2424

2525
/// Total number of bytes requested
26-
var requestedBytes: Int64 = 0
26+
public var requestedBytes: Int64 = 0
2727

2828
/// Total number of bytes allocated if known
29-
var allocatedBytes: Int64 = 0
29+
public var allocatedBytes: Int64 = 0
3030

3131
/// Name of the allocator used
32-
var allocatorName: String = String()
32+
public var allocatorName: String = String()
3333

3434
/// Identifier of the allocated buffer if known
35-
var allocationID: Int64 = 0
35+
public var allocationID: Int64 = 0
3636

3737
/// Set if this tensor only has one remaining reference
38-
var hasSingleReference_p: Bool = false
38+
public var hasSingleReference_p: Bool = false
3939

4040
/// Address of the allocation.
41-
var ptr: UInt64 = 0
41+
public var ptr: UInt64 = 0
4242

4343
public var unknownFields = SwiftProtobuf.UnknownStorage()
4444

Sources/PerfectTensorFlow/pb.api_objects.swift

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
1919
typealias Version = _2
2020
}
2121

22-
struct ThirdParty_Tensorflow_Tools_Api_TFAPIMember: SwiftProtobuf.Message {
22+
public struct ThirdParty_Tensorflow_Tools_Api_TFAPIMember: SwiftProtobuf.Message {
2323
public static let protoMessageName: String = _protobuf_package + ".TFAPIMember"
2424

25-
var name: String {
25+
public var name: String {
2626
get {return _name ?? String()}
2727
set {_name = newValue}
2828
}
2929
/// Returns true if `name` has been explicitly set.
30-
var hasName: Bool {return self._name != nil}
30+
public var hasName: Bool {return self._name != nil}
3131
/// Clears the value of `name`. Subsequent reads from it will return its default value.
32-
mutating func clearName() {self._name = nil}
32+
public mutating func clearName() {self._name = nil}
3333

34-
var mtype: String {
34+
public var mtype: String {
3535
get {return _mtype ?? String()}
3636
set {_mtype = newValue}
3737
}
3838
/// Returns true if `mtype` has been explicitly set.
39-
var hasMtype: Bool {return self._mtype != nil}
39+
public var hasMtype: Bool {return self._mtype != nil}
4040
/// Clears the value of `mtype`. Subsequent reads from it will return its default value.
41-
mutating func clearMtype() {self._mtype = nil}
41+
public mutating func clearMtype() {self._mtype = nil}
4242

4343
public var unknownFields = SwiftProtobuf.UnknownStorage()
4444

@@ -76,35 +76,35 @@ struct ThirdParty_Tensorflow_Tools_Api_TFAPIMember: SwiftProtobuf.Message {
7676
fileprivate var _mtype: String? = nil
7777
}
7878

79-
struct ThirdParty_Tensorflow_Tools_Api_TFAPIMethod: SwiftProtobuf.Message {
79+
public struct ThirdParty_Tensorflow_Tools_Api_TFAPIMethod: SwiftProtobuf.Message {
8080
public static let protoMessageName: String = _protobuf_package + ".TFAPIMethod"
8181

82-
var name: String {
82+
public var name: String {
8383
get {return _name ?? String()}
8484
set {_name = newValue}
8585
}
8686
/// Returns true if `name` has been explicitly set.
87-
var hasName: Bool {return self._name != nil}
87+
public var hasName: Bool {return self._name != nil}
8888
/// Clears the value of `name`. Subsequent reads from it will return its default value.
89-
mutating func clearName() {self._name = nil}
89+
public mutating func clearName() {self._name = nil}
9090

91-
var path: String {
91+
public var path: String {
9292
get {return _path ?? String()}
9393
set {_path = newValue}
9494
}
9595
/// Returns true if `path` has been explicitly set.
96-
var hasPath: Bool {return self._path != nil}
96+
public var hasPath: Bool {return self._path != nil}
9797
/// Clears the value of `path`. Subsequent reads from it will return its default value.
98-
mutating func clearPath() {self._path = nil}
98+
public mutating func clearPath() {self._path = nil}
9999

100-
var argspec: String {
100+
public var argspec: String {
101101
get {return _argspec ?? String()}
102102
set {_argspec = newValue}
103103
}
104104
/// Returns true if `argspec` has been explicitly set.
105-
var hasArgspec: Bool {return self._argspec != nil}
105+
public var hasArgspec: Bool {return self._argspec != nil}
106106
/// Clears the value of `argspec`. Subsequent reads from it will return its default value.
107-
mutating func clearArgspec() {self._argspec = nil}
107+
public mutating func clearArgspec() {self._argspec = nil}
108108

109109
public var unknownFields = SwiftProtobuf.UnknownStorage()
110110

@@ -147,12 +147,12 @@ struct ThirdParty_Tensorflow_Tools_Api_TFAPIMethod: SwiftProtobuf.Message {
147147
fileprivate var _argspec: String? = nil
148148
}
149149

150-
struct ThirdParty_Tensorflow_Tools_Api_TFAPIModule: SwiftProtobuf.Message {
150+
public struct ThirdParty_Tensorflow_Tools_Api_TFAPIModule: SwiftProtobuf.Message {
151151
public static let protoMessageName: String = _protobuf_package + ".TFAPIModule"
152152

153-
var member: [ThirdParty_Tensorflow_Tools_Api_TFAPIMember] = []
153+
public var member: [ThirdParty_Tensorflow_Tools_Api_TFAPIMember] = []
154154

155-
var memberMethod: [ThirdParty_Tensorflow_Tools_Api_TFAPIMethod] = []
155+
public var memberMethod: [ThirdParty_Tensorflow_Tools_Api_TFAPIMethod] = []
156156

157157
public var unknownFields = SwiftProtobuf.UnknownStorage()
158158

@@ -187,14 +187,14 @@ struct ThirdParty_Tensorflow_Tools_Api_TFAPIModule: SwiftProtobuf.Message {
187187
}
188188
}
189189

190-
struct ThirdParty_Tensorflow_Tools_Api_TFAPIClass: SwiftProtobuf.Message {
190+
public struct ThirdParty_Tensorflow_Tools_Api_TFAPIClass: SwiftProtobuf.Message {
191191
public static let protoMessageName: String = _protobuf_package + ".TFAPIClass"
192192

193-
var isInstance: [String] = []
193+
public var isInstance: [String] = []
194194

195-
var member: [ThirdParty_Tensorflow_Tools_Api_TFAPIMember] = []
195+
public var member: [ThirdParty_Tensorflow_Tools_Api_TFAPIMember] = []
196196

197-
var memberMethod: [ThirdParty_Tensorflow_Tools_Api_TFAPIMethod] = []
197+
public var memberMethod: [ThirdParty_Tensorflow_Tools_Api_TFAPIMethod] = []
198198

199199
public var unknownFields = SwiftProtobuf.UnknownStorage()
200200

@@ -233,35 +233,35 @@ struct ThirdParty_Tensorflow_Tools_Api_TFAPIClass: SwiftProtobuf.Message {
233233
}
234234
}
235235

236-
struct ThirdParty_Tensorflow_Tools_Api_TFAPIObject: SwiftProtobuf.Message {
236+
public struct ThirdParty_Tensorflow_Tools_Api_TFAPIObject: SwiftProtobuf.Message {
237237
public static let protoMessageName: String = _protobuf_package + ".TFAPIObject"
238238

239-
var path: String {
239+
public var path: String {
240240
get {return _storage._path ?? String()}
241241
set {_uniqueStorage()._path = newValue}
242242
}
243243
/// Returns true if `path` has been explicitly set.
244-
var hasPath: Bool {return _storage._path != nil}
244+
public var hasPath: Bool {return _storage._path != nil}
245245
/// Clears the value of `path`. Subsequent reads from it will return its default value.
246-
mutating func clearPath() {_storage._path = nil}
246+
public mutating func clearPath() {_storage._path = nil}
247247

248-
var tfModule: ThirdParty_Tensorflow_Tools_Api_TFAPIModule {
248+
public var tfModule: ThirdParty_Tensorflow_Tools_Api_TFAPIModule {
249249
get {return _storage._tfModule ?? ThirdParty_Tensorflow_Tools_Api_TFAPIModule()}
250250
set {_uniqueStorage()._tfModule = newValue}
251251
}
252252
/// Returns true if `tfModule` has been explicitly set.
253-
var hasTfModule: Bool {return _storage._tfModule != nil}
253+
public var hasTfModule: Bool {return _storage._tfModule != nil}
254254
/// Clears the value of `tfModule`. Subsequent reads from it will return its default value.
255-
mutating func clearTfModule() {_storage._tfModule = nil}
255+
public mutating func clearTfModule() {_storage._tfModule = nil}
256256

257-
var tfClass: ThirdParty_Tensorflow_Tools_Api_TFAPIClass {
257+
public var tfClass: ThirdParty_Tensorflow_Tools_Api_TFAPIClass {
258258
get {return _storage._tfClass ?? ThirdParty_Tensorflow_Tools_Api_TFAPIClass()}
259259
set {_uniqueStorage()._tfClass = newValue}
260260
}
261261
/// Returns true if `tfClass` has been explicitly set.
262-
var hasTfClass: Bool {return _storage._tfClass != nil}
262+
public var hasTfClass: Bool {return _storage._tfClass != nil}
263263
/// Clears the value of `tfClass`. Subsequent reads from it will return its default value.
264-
mutating func clearTfClass() {_storage._tfClass = nil}
264+
public mutating func clearTfClass() {_storage._tfClass = nil}
265265

266266
public var unknownFields = SwiftProtobuf.UnknownStorage()
267267

@@ -385,7 +385,7 @@ extension ThirdParty_Tensorflow_Tools_Api_TFAPIObject: SwiftProtobuf._MessageImp
385385

386386
static let defaultInstance = _StorageClass()
387387

388-
public init() {}
388+
private init() {}
389389

390390
init(copying source: _StorageClass) {
391391
_path = source._path
@@ -403,7 +403,7 @@ extension ThirdParty_Tensorflow_Tools_Api_TFAPIObject: SwiftProtobuf._MessageImp
403403

404404
public func _protobuf_generated_isEqualTo(other: ThirdParty_Tensorflow_Tools_Api_TFAPIObject) -> Bool {
405405
if _storage !== other._storage {
406-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
406+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
407407
if _storage._path != other_storage._path {return false}
408408
if _storage._tfModule != other_storage._tfModule {return false}
409409
if _storage._tfClass != other_storage._tfClass {return false}

Sources/PerfectTensorFlow/pb.attr_value.swift

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
2525
public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
2626
public static let protoMessageName: String = _protobuf_package + ".AttrValue"
2727

28-
var value: OneOf_Value? {
28+
public var value: OneOf_Value? {
2929
get {return _storage._value}
3030
set {_uniqueStorage()._value = newValue}
3131
}
3232

3333
/// "string"
34-
var s: Data {
34+
public var s: Data {
3535
get {
3636
if case .s(let v)? = _storage._value {return v}
3737
return SwiftProtobuf.Internal.emptyData
@@ -40,7 +40,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
4040
}
4141

4242
/// "int"
43-
var i: Int64 {
43+
public var i: Int64 {
4444
get {
4545
if case .i(let v)? = _storage._value {return v}
4646
return 0
@@ -49,7 +49,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
4949
}
5050

5151
/// "float"
52-
var f: Float {
52+
public var f: Float {
5353
get {
5454
if case .f(let v)? = _storage._value {return v}
5555
return 0
@@ -58,7 +58,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
5858
}
5959

6060
/// "bool"
61-
var b: Bool {
61+
public var b: Bool {
6262
get {
6363
if case .b(let v)? = _storage._value {return v}
6464
return false
@@ -67,7 +67,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
6767
}
6868

6969
/// "type"
70-
var type: Tensorflow_DataType {
70+
public var type: Tensorflow_DataType {
7171
get {
7272
if case .type(let v)? = _storage._value {return v}
7373
return .dtInvalid
@@ -76,7 +76,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
7676
}
7777

7878
/// "shape"
79-
var shape: Tensorflow_TensorShapeProto {
79+
public var shape: Tensorflow_TensorShapeProto {
8080
get {
8181
if case .shape(let v)? = _storage._value {return v}
8282
return Tensorflow_TensorShapeProto()
@@ -85,7 +85,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
8585
}
8686

8787
/// "tensor"
88-
var tensor: Tensorflow_TensorProto {
88+
public var tensor: Tensorflow_TensorProto {
8989
get {
9090
if case .tensor(let v)? = _storage._value {return v}
9191
return Tensorflow_TensorProto()
@@ -94,7 +94,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
9494
}
9595

9696
/// any "list(...)"
97-
var list: Tensorflow_AttrValue.ListValue {
97+
public var list: Tensorflow_AttrValue.ListValue {
9898
get {
9999
if case .list(let v)? = _storage._value {return v}
100100
return Tensorflow_AttrValue.ListValue()
@@ -106,7 +106,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
106106
/// a primitive op's name. func.attr.first is the name of an attr
107107
/// defined for that function. func.attr.second is the value for
108108
/// that attr in the instantiation.
109-
var `func`: Tensorflow_NameAttrList {
109+
public var `func`: Tensorflow_NameAttrList {
110110
get {
111111
if case .func(let v)? = _storage._value {return v}
112112
return Tensorflow_NameAttrList()
@@ -121,7 +121,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
121121
/// placeholder = "foo". When FN is instantiated with attr "foo"
122122
/// set to "bar", the instantiated node N's attr A will have been
123123
/// given the value "bar".
124-
var placeholder: String {
124+
public var placeholder: String {
125125
get {
126126
if case .placeholder(let v)? = _storage._value {return v}
127127
return String()
@@ -131,7 +131,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
131131

132132
public var unknownFields = SwiftProtobuf.UnknownStorage()
133133

134-
enum OneOf_Value: Equatable {
134+
public enum OneOf_Value: Equatable {
135135
/// "string"
136136
case s(Data)
137137
/// "int"
@@ -162,7 +162,7 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
162162
/// given the value "bar".
163163
case placeholder(String)
164164

165-
static func ==(lhs: Tensorflow_AttrValue.OneOf_Value, rhs: Tensorflow_AttrValue.OneOf_Value) -> Bool {
165+
public static func ==(lhs: Tensorflow_AttrValue.OneOf_Value, rhs: Tensorflow_AttrValue.OneOf_Value) -> Bool {
166166
switch (lhs, rhs) {
167167
case (.s(let l), .s(let r)): return l == r
168168
case (.i(let l), .i(let r)): return l == r
@@ -180,32 +180,32 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
180180
}
181181

182182
/// LINT.IfChange
183-
struct ListValue: SwiftProtobuf.Message {
183+
public struct ListValue: SwiftProtobuf.Message {
184184
public static let protoMessageName: String = Tensorflow_AttrValue.protoMessageName + ".ListValue"
185185

186186
/// "list(string)"
187-
var s: [Data] = []
187+
public var s: [Data] = []
188188

189189
/// "list(int)"
190-
var i: [Int64] = []
190+
public var i: [Int64] = []
191191

192192
/// "list(float)"
193-
var f: [Float] = []
193+
public var f: [Float] = []
194194

195195
/// "list(bool)"
196-
var b: [Bool] = []
196+
public var b: [Bool] = []
197197

198198
/// "list(type)"
199-
var type: [Tensorflow_DataType] = []
199+
public var type: [Tensorflow_DataType] = []
200200

201201
/// "list(shape)"
202-
var shape: [Tensorflow_TensorShapeProto] = []
202+
public var shape: [Tensorflow_TensorShapeProto] = []
203203

204204
/// "list(tensor)"
205-
var tensor: [Tensorflow_TensorProto] = []
205+
public var tensor: [Tensorflow_TensorProto] = []
206206

207207
/// "list(attr)"
208-
var `func`: [Tensorflow_NameAttrList] = []
208+
public var `func`: [Tensorflow_NameAttrList] = []
209209

210210
public var unknownFields = SwiftProtobuf.UnknownStorage()
211211

@@ -384,9 +384,9 @@ public struct Tensorflow_AttrValue: SwiftProtobuf.Message {
384384
public struct Tensorflow_NameAttrList: SwiftProtobuf.Message {
385385
public static let protoMessageName: String = _protobuf_package + ".NameAttrList"
386386

387-
var name: String = String()
387+
public var name: String = String()
388388

389-
var attr: Dictionary<String,Tensorflow_AttrValue> = [:]
389+
public var attr: Dictionary<String,Tensorflow_AttrValue> = [:]
390390

391391
public var unknownFields = SwiftProtobuf.UnknownStorage()
392392

@@ -444,7 +444,7 @@ extension Tensorflow_AttrValue: SwiftProtobuf._MessageImplementationBase, SwiftP
444444

445445
static let defaultInstance = _StorageClass()
446446

447-
public init() {}
447+
private init() {}
448448

449449
init(copying source: _StorageClass) {
450450
_value = source._value
@@ -460,7 +460,7 @@ extension Tensorflow_AttrValue: SwiftProtobuf._MessageImplementationBase, SwiftP
460460

461461
public func _protobuf_generated_isEqualTo(other: Tensorflow_AttrValue) -> Bool {
462462
if _storage !== other._storage {
463-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
463+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
464464
if _storage._value != other_storage._value {return false}
465465
return true
466466
}

0 commit comments

Comments
 (0)