Skip to content

Commit 8c67a5a

Browse files
authored
Make Ops classes accessible from sub-Ops classes (#150)
* Adjust sub-Ops classes to take Ops in their constructor instead of Scope, and get the scope from that. Save Ops parameter to field and add accessor for it. Signed-off-by: Ryan Nett <[email protected]> * remove unlinked LinalgSparseOps Signed-off-by: Ryan Nett <[email protected]>
1 parent a34174b commit 8c67a5a

24 files changed

+293
-534
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@
3434
public final class AudioOps {
3535
private final Scope scope;
3636

37-
AudioOps(Scope scope) {
38-
this.scope = scope;
37+
private final Ops ops;
38+
39+
AudioOps(Ops ops) {
40+
this.scope = ops.scope();
41+
this.ops = ops;
3942
}
4043

4144
/**
@@ -144,4 +147,11 @@ public Mfcc mfcc(Operand<TFloat32> spectrogram, Operand<TInt32> sampleRate,
144147
Mfcc.Options... options) {
145148
return Mfcc.create(scope, spectrogram, sampleRate, options);
146149
}
150+
151+
/**
152+
* Get the parent {@link Ops} object.
153+
*/
154+
public final Ops ops() {
155+
return ops;
156+
}
147157
}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@
3434
public final class BitwiseOps {
3535
private final Scope scope;
3636

37-
BitwiseOps(Scope scope) {
38-
this.scope = scope;
37+
private final Ops ops;
38+
39+
BitwiseOps(Ops ops) {
40+
this.scope = ops.scope();
41+
this.ops = ops;
3942
}
4043

4144
/**
@@ -268,4 +271,11 @@ public <T extends TNumber> LeftShift<T> leftShift(Operand<T> x, Operand<T> y) {
268271
public <T extends TNumber> RightShift<T> rightShift(Operand<T> x, Operand<T> y) {
269272
return RightShift.create(scope, x, y);
270273
}
274+
275+
/**
276+
* Get the parent {@link Ops} object.
277+
*/
278+
public final Ops ops() {
279+
return ops;
280+
}
271281
}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@
3333
public final class DataExperimentalOps {
3434
private final Scope scope;
3535

36-
DataExperimentalOps(Scope scope) {
37-
this.scope = scope;
36+
private final Ops ops;
37+
38+
DataExperimentalOps(Ops ops) {
39+
this.scope = ops.scope();
40+
this.ops = ops;
3841
}
3942

4043
/**
@@ -58,4 +61,11 @@ public DataServiceDataset dataServiceDataset(Operand<TInt64> datasetId,
5861
DataServiceDataset.Options... options) {
5962
return DataServiceDataset.create(scope, datasetId, processingMode, address, protocol, jobName, maxOutstandingRequests, iterationCounter, outputTypes, outputShapes, options);
6063
}
64+
65+
/**
66+
* Get the parent {@link Ops} object.
67+
*/
68+
public final Ops ops() {
69+
return ops;
70+
}
6171
}

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@ public final class DataOps {
6060

6161
private final Scope scope;
6262

63-
DataOps(Scope scope) {
64-
this.scope = scope;
65-
experimental = new DataExperimentalOps(scope);
63+
private final Ops ops;
64+
65+
DataOps(Ops ops) {
66+
this.scope = ops.scope();
67+
this.ops = ops;
68+
experimental = new DataExperimentalOps(ops);
6669
}
6770

6871
/**
@@ -410,4 +413,11 @@ public ZipDataset zipDataset(Iterable<Operand<?>> inputDatasets, List<DataType<?
410413
List<Shape> outputShapes) {
411414
return ZipDataset.create(scope, inputDatasets, outputTypes, outputShapes);
412415
}
416+
417+
/**
418+
* Get the parent {@link Ops} object.
419+
*/
420+
public final Ops ops() {
421+
return ops;
422+
}
413423
}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@
3333
public final class DtypesOps {
3434
private final Scope scope;
3535

36-
DtypesOps(Scope scope) {
37-
this.scope = scope;
36+
private final Ops ops;
37+
38+
DtypesOps(Ops ops) {
39+
this.scope = ops.scope();
40+
this.ops = ops;
3841
}
3942

4043
/**
@@ -102,4 +105,11 @@ public <U extends TType, T extends TNumber> Complex<U> complex(Operand<T> real,
102105
DataType<U> Tout) {
103106
return Complex.create(scope, real, imag, Tout);
104107
}
108+
109+
/**
110+
* Get the parent {@link Ops} object.
111+
*/
112+
public final Ops ops() {
113+
return ops;
114+
}
105115
}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@
6666
public final class ImageOps {
6767
private final Scope scope;
6868

69-
ImageOps(Scope scope) {
70-
this.scope = scope;
69+
private final Ops ops;
70+
71+
ImageOps(Ops ops) {
72+
this.scope = ops.scope();
73+
this.ops = ops;
7174
}
7275

7376
/**
@@ -942,4 +945,11 @@ public <T extends TNumber> ScaleAndTranslate scaleAndTranslate(Operand<T> images
942945
ScaleAndTranslate.Options... options) {
943946
return ScaleAndTranslate.create(scope, images, size, scale, translation, options);
944947
}
948+
949+
/**
950+
* Get the parent {@link Ops} object.
951+
*/
952+
public final Ops ops() {
953+
return ops;
954+
}
945955
}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@
8282
public final class IoOps {
8383
private final Scope scope;
8484

85-
IoOps(Scope scope) {
86-
this.scope = scope;
85+
private final Ops ops;
86+
87+
IoOps(Ops ops) {
88+
this.scope = ops.scope();
89+
this.ops = ops;
8790
}
8891

8992
/**
@@ -1030,4 +1033,11 @@ public WholeFileReader wholeFileReader(WholeFileReader.Options... options) {
10301033
public WriteFile writeFile(Operand<TString> filename, Operand<TString> contents) {
10311034
return WriteFile.create(scope, filename, contents);
10321035
}
1036+
1037+
/**
1038+
* Get the parent {@link Ops} object.
1039+
*/
1040+
public final Ops ops() {
1041+
return ops;
1042+
}
10331043
}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@
7878
public final class LinalgOps {
7979
private final Scope scope;
8080

81-
LinalgOps(Scope scope) {
82-
this.scope = scope;
81+
private final Ops ops;
82+
83+
LinalgOps(Ops ops) {
84+
this.scope = ops.scope();
85+
this.ops = ops;
8386
}
8487

8588
/**
@@ -1606,4 +1609,11 @@ public <T extends TType> TriangularSolve<T> triangularSolve(Operand<T> matrix, O
16061609
TriangularSolve.Options... options) {
16071610
return TriangularSolve.create(scope, matrix, rhs, options);
16081611
}
1612+
1613+
/**
1614+
* Get the parent {@link Ops} object.
1615+
*/
1616+
public final Ops ops() {
1617+
return ops;
1618+
}
16091619
}

0 commit comments

Comments
 (0)