@@ -140,22 +140,22 @@ class LazyTensorOperation: TensorOperation {
140
140
}
141
141
142
142
enum Attribute {
143
- case BoolValue ( Bool )
144
- case IntValue ( Int )
145
- case FloatValue ( Float )
146
- case DoubleValue ( Double )
147
- case StringValue ( String )
148
- case BoolArray ( [ Bool ] )
149
- case IntArray ( [ Int ] )
150
- case FloatArray ( [ Float ] )
151
- case DoubleArray ( [ Double ] )
152
- case StringArray ( [ String ] )
153
- case ConstTensor ( TFETensorHandle )
154
- case TensorDataTypeValue ( TensorDataType )
155
- case TensorFunctionPointer ( _TensorFunctionPointer )
156
- case TensorDataTypeArray ( [ TensorDataType ] )
157
- case OptionalTensorShape ( TensorShape ? )
158
- case OptionalTensorShapeArray ( [ TensorShape ? ] )
143
+ case boolValue ( Bool )
144
+ case intValue ( Int )
145
+ case floatValue ( Float )
146
+ case doubleValue ( Double )
147
+ case stringValue ( String )
148
+ case boolArray ( [ Bool ] )
149
+ case intArray ( [ Int ] )
150
+ case floatArray ( [ Float ] )
151
+ case doubleArray ( [ Double ] )
152
+ case stringArray ( [ String ] )
153
+ case constTensor ( TFETensorHandle )
154
+ case tensorDataTypeValue ( TensorDataType )
155
+ case tensorFunctionPointer ( _TensorFunctionPointer )
156
+ case tensorDataTypeArray ( [ TensorDataType ] )
157
+ case optionalTensorShape ( TensorShape ? )
158
+ case optionalTensorShapeArray ( [ TensorShape ? ] )
159
159
}
160
160
161
161
let name : String
@@ -228,49 +228,49 @@ class LazyTensorOperation: TensorOperation {
228
228
}
229
229
230
230
func updateAttribute( _ name: String , _ value: Bool ) {
231
- attributes [ name] = Attribute . BoolValue ( value)
231
+ attributes [ name] = Attribute . boolValue ( value)
232
232
}
233
233
func updateAttribute( _ name: String , _ value: Int ) {
234
- attributes [ name] = Attribute . IntValue ( value)
234
+ attributes [ name] = Attribute . intValue ( value)
235
235
}
236
236
func updateAttribute( _ name: String , _ value: Int32 ) {
237
- attributes [ name] = Attribute . IntValue ( Int ( value) )
237
+ attributes [ name] = Attribute . intValue ( Int ( value) )
238
238
}
239
239
func updateAttribute( _ name: String , _ value: Int64 ) {
240
- attributes [ name] = Attribute . IntValue ( Int ( value) )
240
+ attributes [ name] = Attribute . intValue ( Int ( value) )
241
241
}
242
242
func updateAttribute( _ name: String , _ value: Float ) {
243
- attributes [ name] = Attribute . FloatValue ( value)
243
+ attributes [ name] = Attribute . floatValue ( value)
244
244
}
245
245
func updateAttribute( _ name: String , _ value: Double ) {
246
- attributes [ name] = Attribute . DoubleValue ( value)
246
+ attributes [ name] = Attribute . doubleValue ( value)
247
247
}
248
248
func updateAttribute( _ name: String , _ value: String ) {
249
- attributes [ name] = Attribute . StringValue ( value)
249
+ attributes [ name] = Attribute . stringValue ( value)
250
250
}
251
251
func updateAttribute( _ name: String , _ value: [ Bool ] ) {
252
- attributes [ name] = Attribute . BoolArray ( value)
252
+ attributes [ name] = Attribute . boolArray ( value)
253
253
}
254
254
func updateAttribute( _ name: String , _ value: [ Int ] ) {
255
- attributes [ name] = Attribute . IntArray ( value)
255
+ attributes [ name] = Attribute . intArray ( value)
256
256
}
257
257
func updateAttribute( _ name: String , _ value: [ Int32 ] ) {
258
- attributes [ name] = Attribute . IntArray ( value. map { Int ( $0) } )
258
+ attributes [ name] = Attribute . intArray ( value. map { Int ( $0) } )
259
259
}
260
260
func updateAttribute( _ name: String , _ value: [ Int64 ] ) {
261
- attributes [ name] = Attribute . IntArray ( value. map { Int ( $0) } )
261
+ attributes [ name] = Attribute . intArray ( value. map { Int ( $0) } )
262
262
}
263
263
func updateAttribute( _ name: String , _ value: [ Float ] ) {
264
- attributes [ name] = Attribute . FloatArray ( value)
264
+ attributes [ name] = Attribute . floatArray ( value)
265
265
}
266
266
func updateAttribute( _ name: String , _ value: [ Double ] ) {
267
- attributes [ name] = Attribute . DoubleArray ( value)
267
+ attributes [ name] = Attribute . doubleArray ( value)
268
268
}
269
269
func updateAttribute( _ name: String , _ value: [ String ] ) {
270
- attributes [ name] = Attribute . StringArray ( value)
270
+ attributes [ name] = Attribute . stringArray ( value)
271
271
}
272
272
func updateAttribute( _ name: String , _ value: _TensorFunctionPointer ) {
273
- attributes [ name] = Attribute . TensorFunctionPointer ( value)
273
+ attributes [ name] = Attribute . tensorFunctionPointer ( value)
274
274
}
275
275
}
276
276
@@ -317,22 +317,22 @@ extension LazyTensorOperation: TFTensorOperation {
317
317
}
318
318
319
319
func updateAttribute( _ name: String , _ value: TensorDataType ) {
320
- attributes [ name] = Attribute . TensorDataTypeValue ( value)
320
+ attributes [ name] = Attribute . tensorDataTypeValue ( value)
321
321
}
322
322
func updateAttribute( _ name: String , _ value: TensorShape ) {
323
- attributes [ name] = Attribute . OptionalTensorShape ( value)
323
+ attributes [ name] = Attribute . optionalTensorShape ( value)
324
324
}
325
325
func updateAttribute( _ name: String , _ value: TensorShape ? ) {
326
- attributes [ name] = Attribute . OptionalTensorShape ( value)
326
+ attributes [ name] = Attribute . optionalTensorShape ( value)
327
327
}
328
328
func updateAttribute( _ name: String , _ value: [ TensorDataType ] ) {
329
- attributes [ name] = Attribute . TensorDataTypeArray ( value)
329
+ attributes [ name] = Attribute . tensorDataTypeArray ( value)
330
330
}
331
331
func updateAttribute( _ name: String , _ value: [ TensorShape ] ) {
332
- attributes [ name] = Attribute . OptionalTensorShapeArray ( value)
332
+ attributes [ name] = Attribute . optionalTensorShapeArray ( value)
333
333
}
334
334
func updateAttribute( _ name: String , _ value: [ TensorShape ? ] ) {
335
- attributes [ name] = Attribute . OptionalTensorShapeArray ( value)
335
+ attributes [ name] = Attribute . optionalTensorShapeArray ( value)
336
336
}
337
337
func updateAttribute< In: TensorGroup , Out: TensorGroup > (
338
338
_ name: String , _ value: ( In ) -> Out ) {
@@ -649,25 +649,25 @@ extension TFETensorHandle {
649
649
extension LazyTensorOperation . Attribute : CustomStringConvertible {
650
650
var description : String {
651
651
switch self {
652
- case . BoolValue ( let v) : return " \( v) "
653
- case . IntValue ( let v) : return " Int( \( v) ) "
654
- case . FloatValue ( let v) : return " Float( \( v) ) "
655
- case . DoubleValue ( let v) : return " Double( \( v) ) "
656
- case . StringValue ( let v) : return " \" \( v) \" "
657
- case . BoolArray ( let values) : return arrayAsString ( " " , values)
658
- case . IntArray ( let values) : return arrayAsString ( " Int " , values)
659
- case . FloatArray ( let values) : return arrayAsString ( " Float " , values)
660
- case . DoubleArray ( let values) : return arrayAsString ( " Double " , values)
661
- case . StringArray ( let values) : return arrayAsString ( " String " , values)
662
- case . ConstTensor ( let v) : return v. valueDescription
663
- case . TensorDataTypeValue ( let v) : return dataTypeAsString ( v)
664
- case . TensorFunctionPointer ( let v) : return " TFFunction( \( v. name) ) "
665
- case . TensorDataTypeArray ( let values) :
652
+ case . boolValue ( let v) : return " \( v) "
653
+ case . intValue ( let v) : return " Int( \( v) ) "
654
+ case . floatValue ( let v) : return " Float( \( v) ) "
655
+ case . doubleValue ( let v) : return " Double( \( v) ) "
656
+ case . stringValue ( let v) : return " \" \( v) \" "
657
+ case . boolArray ( let values) : return arrayAsString ( " " , values)
658
+ case . intArray ( let values) : return arrayAsString ( " Int " , values)
659
+ case . floatArray ( let values) : return arrayAsString ( " Float " , values)
660
+ case . doubleArray ( let values) : return arrayAsString ( " Double " , values)
661
+ case . stringArray ( let values) : return arrayAsString ( " String " , values)
662
+ case . constTensor ( let v) : return v. valueDescription
663
+ case . tensorDataTypeValue ( let v) : return dataTypeAsString ( v)
664
+ case . tensorFunctionPointer ( let v) : return " TFFunction( \( v. name) ) "
665
+ case . tensorDataTypeArray ( let values) :
666
666
let descriptions = values. map { dataTypeAsString ( $0) }
667
667
let descString = descriptions. joined ( separator: " , " )
668
668
return " [ \( descString) ] "
669
- case . OptionalTensorShape ( let t) : return String ( describing: t)
670
- case . OptionalTensorShapeArray ( let t) : return " \( t) "
669
+ case . optionalTensorShape ( let t) : return String ( describing: t)
670
+ case . optionalTensorShapeArray ( let t) : return " \( t) "
671
671
}
672
672
}
673
673
0 commit comments