56
56
final class EagerOperationBuilder implements OperationBuilder {
57
57
58
58
EagerOperationBuilder (EagerSession session , String type , String name ) {
59
- if (!session .isOpEnabled (type ))
59
+ if (!session .isOpEnabled (type )) {
60
60
throw new IllegalArgumentException ("Op " + type + " is not valid in eager mode." );
61
+ }
61
62
62
63
this .session = session ;
63
64
this .type = type ;
@@ -78,15 +79,15 @@ public EagerOperation build() {
78
79
79
80
@ Override
80
81
public EagerOperationBuilder addInput (Output <?> input ) {
81
- addInput (opHandle , (TFE_TensorHandle )input .getUnsafeNativeHandle ());
82
+ addInput (opHandle , (TFE_TensorHandle ) input .getUnsafeNativeHandle ());
82
83
return this ;
83
84
}
84
85
85
86
@ Override
86
87
public EagerOperationBuilder addInputList (Output <?>[] inputs ) {
87
88
TFE_TensorHandle [] inputHandles = new TFE_TensorHandle [inputs .length ];
88
89
for (int i = 0 ; i < inputs .length ; ++i ) {
89
- inputHandles [i ] = (TFE_TensorHandle )inputs [i ].getUnsafeNativeHandle ();
90
+ inputHandles [i ] = (TFE_TensorHandle ) inputs [i ].getUnsafeNativeHandle ();
90
91
}
91
92
addInputList (opHandle , inputHandles );
92
93
return this ;
@@ -229,7 +230,9 @@ public EagerOperationBuilder setAttr(String name, Shape[] values) {
229
230
private final String type ;
230
231
private final String name ;
231
232
232
- /** This value should be >= to the maximum number of outputs in any op */
233
+ /**
234
+ * This value should be >= to the maximum number of outputs in any op
235
+ */
233
236
private static final int MAX_OUTPUTS_PER_OP = 1000 ;
234
237
235
238
private static void requireOp (TFE_Op handle ) {
@@ -361,7 +364,7 @@ private static void setAttrFloatList(TFE_Op opHandle, String name, float[] value
361
364
362
365
private static void setAttrBool (TFE_Op opHandle , String name , boolean value ) {
363
366
requireOp (opHandle );
364
- TFE_OpSetAttrBool (opHandle , name , (byte )(value ? 1 : 0 ));
367
+ TFE_OpSetAttrBool (opHandle , name , (byte ) (value ? 1 : 0 ));
365
368
}
366
369
367
370
private static void setAttrBoolList (TFE_Op opHandle , String name , boolean [] values ) {
@@ -413,7 +416,7 @@ private static void setAttrShapeList(TFE_Op opHandle, String name, long[] shapes
413
416
}
414
417
TF_Status status = TF_Status .newStatus ();
415
418
TFE_OpSetAttrShapeList (opHandle , new BytePointer (name ), shapesPointers , new IntPointer (numDims ),
416
- numDims .length , status );
419
+ numDims .length , status );
417
420
}
418
421
}
419
422
}
0 commit comments