Skip to content

Commit 8371529

Browse files
authored
Add option to run TensorFlow job on the preferred device (via Scope) (#159)
* Draft for DeviceSpec integration * Added generation for Ops * Removed something from generated Ops * Finalized the PR * Refactored Scope.apply method * Handle case of separate usage of control dependencies in Init method
1 parent fee1f59 commit 8371529

File tree

1,163 files changed

+1422
-1176
lines changed

Some content is hidden

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

1,163 files changed

+1422
-1176
lines changed

tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_generator.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,9 @@ void RenderFactoryMethods(const OpSpec& op, const Type& op_class,
246246
writer->EndLine();
247247
}
248248
}
249+
249250
// Add control dependencies, if any.
250-
writer->Append("opBuilder = scope.applyControlDependencies(opBuilder);");
251+
writer->Append("opBuilder = scope.apply(opBuilder);");
251252
writer->EndLine();
252253

253254
for (const AttributeSpec& attribute : op.attributes()) {

tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.nio.charset.Charset;
2121
import java.util.List;
2222
import org.tensorflow.DataType;
23+
import org.tensorflow.DeviceSpec;
2324
import org.tensorflow.EagerSession;
2425
import org.tensorflow.ExecutionEnvironment;
2526
import org.tensorflow.Operand;
@@ -7724,6 +7725,15 @@ public Ops withName(String opName) {
77247725
return new Ops(scope.withName(opName));
77257726
}
77267727

7728+
/**
7729+
* Returns an API that uses the provided DeviceSpec for an op.
7730+
*
7731+
* @see {@link Scope#withDevice(DeviceSpec)}
7732+
*/
7733+
public Ops withDevice(DeviceSpec deviceSpec) {
7734+
return new Ops(scope.withDevice(deviceSpec));
7735+
}
7736+
77277737
/**
77287738
* Returns an API that adds operations to the graph with the provided control dependencies.
77297739
*

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private Options() {
9494
public static AudioSpectrogram create(Scope scope, Operand<TFloat32> input, Long windowSize, Long stride, Options... options) {
9595
OperationBuilder opBuilder = scope.env().opBuilder("AudioSpectrogram", scope.makeOpName("AudioSpectrogram"));
9696
opBuilder.addInput(input.asOutput());
97-
opBuilder = scope.applyControlDependencies(opBuilder);
97+
opBuilder = scope.apply(opBuilder);
9898
opBuilder.setAttr("window_size", windowSize);
9999
opBuilder.setAttr("stride", stride);
100100
if (options != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/DecodeWav.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private Options() {
9090
public static DecodeWav create(Scope scope, Operand<TString> contents, Options... options) {
9191
OperationBuilder opBuilder = scope.env().opBuilder("DecodeWav", scope.makeOpName("DecodeWav"));
9292
opBuilder.addInput(contents.asOutput());
93-
opBuilder = scope.applyControlDependencies(opBuilder);
93+
opBuilder = scope.apply(opBuilder);
9494
if (options != null) {
9595
for (Options opts : options) {
9696
if (opts.desiredChannels != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/EncodeWav.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static EncodeWav create(Scope scope, Operand<TFloat32> audio, Operand<TIn
5656
OperationBuilder opBuilder = scope.env().opBuilder("EncodeWav", scope.makeOpName("EncodeWav"));
5757
opBuilder.addInput(audio.asOutput());
5858
opBuilder.addInput(sampleRate.asOutput());
59-
opBuilder = scope.applyControlDependencies(opBuilder);
59+
opBuilder = scope.apply(opBuilder);
6060
return new EncodeWav(opBuilder.build());
6161
}
6262

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/Mfcc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static Mfcc create(Scope scope, Operand<TFloat32> spectrogram, Operand<TI
104104
OperationBuilder opBuilder = scope.env().opBuilder("Mfcc", scope.makeOpName("Mfcc"));
105105
opBuilder.addInput(spectrogram.asOutput());
106106
opBuilder.addInput(sampleRate.asOutput());
107-
opBuilder = scope.applyControlDependencies(opBuilder);
107+
opBuilder = scope.apply(opBuilder);
108108
if (options != null) {
109109
for (Options opts : options) {
110110
if (opts.upperFrequencyLimit != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseAnd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static <T extends TNumber> BitwiseAnd<T> create(Scope scope, Operand<T> x
6969
OperationBuilder opBuilder = scope.env().opBuilder("BitwiseAnd", scope.makeOpName("BitwiseAnd"));
7070
opBuilder.addInput(x.asOutput());
7171
opBuilder.addInput(y.asOutput());
72-
opBuilder = scope.applyControlDependencies(opBuilder);
72+
opBuilder = scope.apply(opBuilder);
7373
return new BitwiseAnd<T>(opBuilder.build());
7474
}
7575

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseOr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static <T extends TNumber> BitwiseOr<T> create(Scope scope, Operand<T> x,
6969
OperationBuilder opBuilder = scope.env().opBuilder("BitwiseOr", scope.makeOpName("BitwiseOr"));
7070
opBuilder.addInput(x.asOutput());
7171
opBuilder.addInput(y.asOutput());
72-
opBuilder = scope.applyControlDependencies(opBuilder);
72+
opBuilder = scope.apply(opBuilder);
7373
return new BitwiseOr<T>(opBuilder.build());
7474
}
7575

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseXor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static <T extends TNumber> BitwiseXor<T> create(Scope scope, Operand<T> x
6969
OperationBuilder opBuilder = scope.env().opBuilder("BitwiseXor", scope.makeOpName("BitwiseXor"));
7070
opBuilder.addInput(x.asOutput());
7171
opBuilder.addInput(y.asOutput());
72-
opBuilder = scope.applyControlDependencies(opBuilder);
72+
opBuilder = scope.apply(opBuilder);
7373
return new BitwiseXor<T>(opBuilder.build());
7474
}
7575

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/Invert.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public final class Invert<T extends TNumber> extends RawOp implements Operand<T>
8888
public static <T extends TNumber> Invert<T> create(Scope scope, Operand<T> x) {
8989
OperationBuilder opBuilder = scope.env().opBuilder("Invert", scope.makeOpName("Invert"));
9090
opBuilder.addInput(x.asOutput());
91-
opBuilder = scope.applyControlDependencies(opBuilder);
91+
opBuilder = scope.apply(opBuilder);
9292
return new Invert<T>(opBuilder.build());
9393
}
9494

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/LeftShift.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static <T extends TNumber> LeftShift<T> create(Scope scope, Operand<T> x,
8080
OperationBuilder opBuilder = scope.env().opBuilder("LeftShift", scope.makeOpName("LeftShift"));
8181
opBuilder.addInput(x.asOutput());
8282
opBuilder.addInput(y.asOutput());
83-
opBuilder = scope.applyControlDependencies(opBuilder);
83+
opBuilder = scope.apply(opBuilder);
8484
return new LeftShift<T>(opBuilder.build());
8585
}
8686

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/RightShift.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static <T extends TNumber> RightShift<T> create(Scope scope, Operand<T> x
8383
OperationBuilder opBuilder = scope.env().opBuilder("RightShift", scope.makeOpName("RightShift"));
8484
opBuilder.addInput(x.asOutput());
8585
opBuilder.addInput(y.asOutput());
86-
opBuilder = scope.applyControlDependencies(opBuilder);
86+
opBuilder = scope.apply(opBuilder);
8787
return new RightShift<T>(opBuilder.build());
8888
}
8989

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KMC2ChainInitialization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static KMC2ChainInitialization create(Scope scope, Operand<TFloat32> dist
5252
OperationBuilder opBuilder = scope.env().opBuilder("KMC2ChainInitialization", scope.makeOpName("KMC2ChainInitialization"));
5353
opBuilder.addInput(distances.asOutput());
5454
opBuilder.addInput(seed.asOutput());
55-
opBuilder = scope.applyControlDependencies(opBuilder);
55+
opBuilder = scope.apply(opBuilder);
5656
return new KMC2ChainInitialization(opBuilder.build());
5757
}
5858

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KmeansPlusPlusInitialization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static KmeansPlusPlusInitialization create(Scope scope, Operand<TFloat32>
5858
opBuilder.addInput(numToSample.asOutput());
5959
opBuilder.addInput(seed.asOutput());
6060
opBuilder.addInput(numRetriesPerSample.asOutput());
61-
opBuilder = scope.applyControlDependencies(opBuilder);
61+
opBuilder = scope.apply(opBuilder);
6262
return new KmeansPlusPlusInitialization(opBuilder.build());
6363
}
6464

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private Options() {
9191
public static <T extends TNumber> AllReduce<T> create(Scope scope, Operand<T> input, Long groupSize, Long groupKey, Long instanceKey, String mergeOp, String finalOp, List<Long> subdivOffsets, Options... options) {
9292
OperationBuilder opBuilder = scope.env().opBuilder("CollectiveReduce", scope.makeOpName("AllReduce"));
9393
opBuilder.addInput(input.asOutput());
94-
opBuilder = scope.applyControlDependencies(opBuilder);
94+
opBuilder = scope.apply(opBuilder);
9595
opBuilder.setAttr("group_size", groupSize);
9696
opBuilder.setAttr("group_key", groupKey);
9797
opBuilder.setAttr("instance_key", instanceKey);

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private Options() {
7979
@Endpoint(describeByClass = true)
8080
public static <T extends TType> BroadcastRecv<T> create(Scope scope, DataType<T> T, Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) {
8181
OperationBuilder opBuilder = scope.env().opBuilder("CollectiveBcastRecv", scope.makeOpName("BroadcastRecv"));
82-
opBuilder = scope.applyControlDependencies(opBuilder);
82+
opBuilder = scope.apply(opBuilder);
8383
opBuilder.setAttr("T", T);
8484
opBuilder.setAttr("group_size", groupSize);
8585
opBuilder.setAttr("group_key", groupKey);

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private Options() {
7979
public static <T extends TType> BroadcastSend<T> create(Scope scope, Operand<T> input, Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) {
8080
OperationBuilder opBuilder = scope.env().opBuilder("CollectiveBcastSend", scope.makeOpName("BroadcastSend"));
8181
opBuilder.addInput(input.asOutput());
82-
opBuilder = scope.applyControlDependencies(opBuilder);
82+
opBuilder = scope.apply(opBuilder);
8383
opBuilder.setAttr("group_size", groupSize);
8484
opBuilder.setAttr("group_key", groupKey);
8585
opBuilder.setAttr("instance_key", instanceKey);

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private Options() {
7373
@Endpoint(describeByClass = true)
7474
public static Abort create(Scope scope, Options... options) {
7575
OperationBuilder opBuilder = scope.env().opBuilder("Abort", scope.makeOpName("Abort"));
76-
opBuilder = scope.applyControlDependencies(opBuilder);
76+
opBuilder = scope.apply(opBuilder);
7777
if (options != null) {
7878
for (Options opts : options) {
7979
if (opts.errorMsg != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/All.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static <T extends TNumber> All create(Scope scope, Operand<TBool> input,
7474
OperationBuilder opBuilder = scope.env().opBuilder("All", scope.makeOpName("All"));
7575
opBuilder.addInput(input.asOutput());
7676
opBuilder.addInput(axis.asOutput());
77-
opBuilder = scope.applyControlDependencies(opBuilder);
77+
opBuilder = scope.apply(opBuilder);
7878
if (options != null) {
7979
for (Options opts : options) {
8080
if (opts.keepDims != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Any.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static <T extends TNumber> Any create(Scope scope, Operand<TBool> input,
7474
OperationBuilder opBuilder = scope.env().opBuilder("Any", scope.makeOpName("Any"));
7575
opBuilder.addInput(input.asOutput());
7676
opBuilder.addInput(axis.asOutput());
77-
opBuilder = scope.applyControlDependencies(opBuilder);
77+
opBuilder = scope.apply(opBuilder);
7878
if (options != null) {
7979
for (Options opts : options) {
8080
if (opts.keepDims != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertThat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static AssertThat create(Scope scope, Operand<TBool> condition, Iterable<
6969
OperationBuilder opBuilder = scope.env().opBuilder("Assert", scope.makeOpName("AssertThat"));
7070
opBuilder.addInput(condition.asOutput());
7171
opBuilder.addInputList(Operands.asOutputs(data));
72-
opBuilder = scope.applyControlDependencies(opBuilder);
72+
opBuilder = scope.apply(opBuilder);
7373
if (options != null) {
7474
for (Options opts : options) {
7575
if (opts.summarize != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Assign.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static <T extends TType> Assign<T> create(Scope scope, Operand<T> ref, Op
8383
OperationBuilder opBuilder = scope.env().opBuilder("Assign", scope.makeOpName("Assign"));
8484
opBuilder.addInput(ref.asOutput());
8585
opBuilder.addInput(value.asOutput());
86-
opBuilder = scope.applyControlDependencies(opBuilder);
86+
opBuilder = scope.apply(opBuilder);
8787
if (options != null) {
8888
for (Options opts : options) {
8989
if (opts.validateShape != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAdd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static <T extends TType> AssignAdd<T> create(Scope scope, Operand<T> ref,
7272
OperationBuilder opBuilder = scope.env().opBuilder("AssignAdd", scope.makeOpName("AssignAdd"));
7373
opBuilder.addInput(ref.asOutput());
7474
opBuilder.addInput(value.asOutput());
75-
opBuilder = scope.applyControlDependencies(opBuilder);
75+
opBuilder = scope.apply(opBuilder);
7676
if (options != null) {
7777
for (Options opts : options) {
7878
if (opts.useLocking != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAddVariableOp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static <T extends TType> AssignAddVariableOp create(Scope scope, Operand<
4848
OperationBuilder opBuilder = scope.env().opBuilder("AssignAddVariableOp", scope.makeOpName("AssignAddVariableOp"));
4949
opBuilder.addInput(resource.asOutput());
5050
opBuilder.addInput(value.asOutput());
51-
opBuilder = scope.applyControlDependencies(opBuilder);
51+
opBuilder = scope.apply(opBuilder);
5252
return new AssignAddVariableOp(opBuilder.build());
5353
}
5454

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static <T extends TType> AssignSub<T> create(Scope scope, Operand<T> ref,
7272
OperationBuilder opBuilder = scope.env().opBuilder("AssignSub", scope.makeOpName("AssignSub"));
7373
opBuilder.addInput(ref.asOutput());
7474
opBuilder.addInput(value.asOutput());
75-
opBuilder = scope.applyControlDependencies(opBuilder);
75+
opBuilder = scope.apply(opBuilder);
7676
if (options != null) {
7777
for (Options opts : options) {
7878
if (opts.useLocking != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSubVariableOp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static <T extends TType> AssignSubVariableOp create(Scope scope, Operand<
4848
OperationBuilder opBuilder = scope.env().opBuilder("AssignSubVariableOp", scope.makeOpName("AssignSubVariableOp"));
4949
opBuilder.addInput(resource.asOutput());
5050
opBuilder.addInput(value.asOutput());
51-
opBuilder = scope.applyControlDependencies(opBuilder);
51+
opBuilder = scope.apply(opBuilder);
5252
return new AssignSubVariableOp(opBuilder.build());
5353
}
5454

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignVariableOp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static <T extends TType> AssignVariableOp create(Scope scope, Operand<?>
4848
OperationBuilder opBuilder = scope.env().opBuilder("AssignVariableOp", scope.makeOpName("AssignVariableOp"));
4949
opBuilder.addInput(resource.asOutput());
5050
opBuilder.addInput(value.asOutput());
51-
opBuilder = scope.applyControlDependencies(opBuilder);
51+
opBuilder = scope.apply(opBuilder);
5252
return new AssignVariableOp(opBuilder.build());
5353
}
5454

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Barrier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private Options() {
107107
@Endpoint(describeByClass = true)
108108
public static Barrier create(Scope scope, List<DataType<?>> componentTypes, Options... options) {
109109
OperationBuilder opBuilder = scope.env().opBuilder("Barrier", scope.makeOpName("Barrier"));
110-
opBuilder = scope.applyControlDependencies(opBuilder);
110+
opBuilder = scope.apply(opBuilder);
111111
DataType[] componentTypesArray = new DataType[componentTypes.size()];
112112
for (int i = 0; i < componentTypesArray.length; ++i) {
113113
componentTypesArray[i] = componentTypes.get(i);

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierClose.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private Options() {
7272
public static BarrierClose create(Scope scope, Operand<TString> handle, Options... options) {
7373
OperationBuilder opBuilder = scope.env().opBuilder("BarrierClose", scope.makeOpName("BarrierClose"));
7474
opBuilder.addInput(handle.asOutput());
75-
opBuilder = scope.applyControlDependencies(opBuilder);
75+
opBuilder = scope.apply(opBuilder);
7676
if (options != null) {
7777
for (Options opts : options) {
7878
if (opts.cancelPendingEnqueues != null) {

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierIncompleteSize.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public final class BarrierIncompleteSize extends RawOp implements Operand<TInt32
4545
public static BarrierIncompleteSize create(Scope scope, Operand<TString> handle) {
4646
OperationBuilder opBuilder = scope.env().opBuilder("BarrierIncompleteSize", scope.makeOpName("BarrierIncompleteSize"));
4747
opBuilder.addInput(handle.asOutput());
48-
opBuilder = scope.applyControlDependencies(opBuilder);
48+
opBuilder = scope.apply(opBuilder);
4949
return new BarrierIncompleteSize(opBuilder.build());
5050
}
5151

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierInsertMany.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static <T extends TType> BarrierInsertMany create(Scope scope, Operand<TS
5555
opBuilder.addInput(handle.asOutput());
5656
opBuilder.addInput(keys.asOutput());
5757
opBuilder.addInput(values.asOutput());
58-
opBuilder = scope.applyControlDependencies(opBuilder);
58+
opBuilder = scope.apply(opBuilder);
5959
opBuilder.setAttr("component_index", componentIndex);
6060
return new BarrierInsertMany(opBuilder.build());
6161
}

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierReadySize.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public final class BarrierReadySize extends RawOp implements Operand<TInt32> {
4545
public static BarrierReadySize create(Scope scope, Operand<TString> handle) {
4646
OperationBuilder opBuilder = scope.env().opBuilder("BarrierReadySize", scope.makeOpName("BarrierReadySize"));
4747
opBuilder.addInput(handle.asOutput());
48-
opBuilder = scope.applyControlDependencies(opBuilder);
48+
opBuilder = scope.apply(opBuilder);
4949
return new BarrierReadySize(opBuilder.build());
5050
}
5151

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierTakeMany.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static BarrierTakeMany create(Scope scope, Operand<TString> handle, Opera
102102
OperationBuilder opBuilder = scope.env().opBuilder("BarrierTakeMany", scope.makeOpName("BarrierTakeMany"));
103103
opBuilder.addInput(handle.asOutput());
104104
opBuilder.addInput(numElements.asOutput());
105-
opBuilder = scope.applyControlDependencies(opBuilder);
105+
opBuilder = scope.apply(opBuilder);
106106
DataType[] componentTypesArray = new DataType[componentTypes.size()];
107107
for (int i = 0; i < componentTypesArray.length; ++i) {
108108
componentTypesArray[i] = componentTypes.get(i);

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Batch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private Options() {
144144
public static Batch create(Scope scope, Iterable<Operand<?>> inTensors, Long numBatchThreads, Long maxBatchSize, Long batchTimeoutMicros, Long gradTimeoutMicros, Options... options) {
145145
OperationBuilder opBuilder = scope.env().opBuilder("Batch", scope.makeOpName("Batch"));
146146
opBuilder.addInputList(Operands.asOutputs(inTensors));
147-
opBuilder = scope.applyControlDependencies(opBuilder);
147+
opBuilder = scope.apply(opBuilder);
148148
opBuilder.setAttr("num_batch_threads", numBatchThreads);
149149
opBuilder.setAttr("max_batch_size", maxBatchSize);
150150
opBuilder.setAttr("batch_timeout_micros", batchTimeoutMicros);

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static <T extends TType, U extends TNumber> BatchToSpace<T> create(Scope
6565
OperationBuilder opBuilder = scope.env().opBuilder("BatchToSpace", scope.makeOpName("BatchToSpace"));
6666
opBuilder.addInput(input.asOutput());
6767
opBuilder.addInput(crops.asOutput());
68-
opBuilder = scope.applyControlDependencies(opBuilder);
68+
opBuilder = scope.apply(opBuilder);
6969
opBuilder.setAttr("block_size", blockSize);
7070
return new BatchToSpace<T>(opBuilder.build());
7171
}

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpaceNd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public static <T extends TType, U extends TNumber, V extends TNumber> BatchToSpa
153153
opBuilder.addInput(input.asOutput());
154154
opBuilder.addInput(blockShape.asOutput());
155155
opBuilder.addInput(crops.asOutput());
156-
opBuilder = scope.applyControlDependencies(opBuilder);
156+
opBuilder = scope.apply(opBuilder);
157157
return new BatchToSpaceNd<T>(opBuilder.build());
158158
}
159159

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bitcast.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public final class Bitcast<U extends TType> extends RawOp implements Operand<U>
9999
public static <U extends TType, T extends TType> Bitcast<U> create(Scope scope, Operand<T> input, DataType<U> type) {
100100
OperationBuilder opBuilder = scope.env().opBuilder("Bitcast", scope.makeOpName("Bitcast"));
101101
opBuilder.addInput(input.asOutput());
102-
opBuilder = scope.applyControlDependencies(opBuilder);
102+
opBuilder = scope.apply(opBuilder);
103103
opBuilder.setAttr("type", type);
104104
return new Bitcast<U>(opBuilder.build());
105105
}

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastDynamicShape.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static <T extends TNumber> BroadcastDynamicShape<T> create(Scope scope, O
5252
OperationBuilder opBuilder = scope.env().opBuilder("BroadcastArgs", scope.makeOpName("BroadcastDynamicShape"));
5353
opBuilder.addInput(s0.asOutput());
5454
opBuilder.addInput(s1.asOutput());
55-
opBuilder = scope.applyControlDependencies(opBuilder);
55+
opBuilder = scope.apply(opBuilder);
5656
return new BroadcastDynamicShape<T>(opBuilder.build());
5757
}
5858

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastGradientArgs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static <T extends TNumber> BroadcastGradientArgs<T> create(Scope scope, O
5050
OperationBuilder opBuilder = scope.env().opBuilder("BroadcastGradientArgs", scope.makeOpName("BroadcastGradientArgs"));
5151
opBuilder.addInput(s0.asOutput());
5252
opBuilder.addInput(s1.asOutput());
53-
opBuilder = scope.applyControlDependencies(opBuilder);
53+
opBuilder = scope.apply(opBuilder);
5454
return new BroadcastGradientArgs<T>(opBuilder.build());
5555
}
5656

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastTo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static <T extends TType, U extends TNumber> BroadcastTo<T> create(Scope s
7777
OperationBuilder opBuilder = scope.env().opBuilder("BroadcastTo", scope.makeOpName("BroadcastTo"));
7878
opBuilder.addInput(input.asOutput());
7979
opBuilder.addInput(shape.asOutput());
80-
opBuilder = scope.applyControlDependencies(opBuilder);
80+
opBuilder = scope.apply(opBuilder);
8181
return new BroadcastTo<T>(opBuilder.build());
8282
}
8383

0 commit comments

Comments
 (0)