Skip to content

Commit f65825a

Browse files
committed
Upgrade to TF2.15
1 parent da9baae commit f65825a

94 files changed

Lines changed: 3669 additions & 917 deletions

File tree

Some content is hidden

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

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

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
import org.tensorflow.op.core.EnsureShape;
9898
import org.tensorflow.op.core.ExpandDims;
9999
import org.tensorflow.op.core.ExtractVolumePatches;
100+
import org.tensorflow.op.core.FFTND;
100101
import org.tensorflow.op.core.Fill;
101102
import org.tensorflow.op.core.Fingerprint;
102103
import org.tensorflow.op.core.For;
@@ -110,6 +111,8 @@
110111
import org.tensorflow.op.core.HashTable;
111112
import org.tensorflow.op.core.Helpers;
112113
import org.tensorflow.op.core.HistogramFixedWidth;
114+
import org.tensorflow.op.core.IFFTND;
115+
import org.tensorflow.op.core.IRFFTND;
113116
import org.tensorflow.op.core.Identity;
114117
import org.tensorflow.op.core.IdentityN;
115118
import org.tensorflow.op.core.If;
@@ -166,6 +169,7 @@
166169
import org.tensorflow.op.core.Print;
167170
import org.tensorflow.op.core.Prod;
168171
import org.tensorflow.op.core.QuantizedReshape;
172+
import org.tensorflow.op.core.RFFTND;
169173
import org.tensorflow.op.core.RaggedFillEmptyRows;
170174
import org.tensorflow.op.core.RaggedFillEmptyRowsGrad;
171175
import org.tensorflow.op.core.RandomIndexShuffle;
@@ -2683,6 +2687,29 @@ public <T extends TNumber> ExtractVolumePatches<T> extractVolumePatches(Operand<
26832687
return ExtractVolumePatches.create(scope, input, ksizes, strides, padding);
26842688
}
26852689

2690+
/**
2691+
* ND fast Fourier transform.
2692+
* Computes the n-dimensional discrete Fourier transform over
2693+
* designated dimensions of {@code input}. The designated dimensions of
2694+
* {@code input} are assumed to be the result of {@code FFTND}.
2695+
* <p>If fft_length[i]&lt;shape(input)[i], the input is cropped. If
2696+
* fft_length[i]&gt;shape(input)[i], the input is padded with zeros. If fft_length
2697+
* is not given, the default shape(input) is used.
2698+
* <p>Axes mean the dimensions to perform the transform on. Default is to perform on
2699+
* all axes.
2700+
*
2701+
* @param <T> data type for {@code output} output
2702+
* @param input A complex tensor.
2703+
* @param fftLength An int32 tensor. The FFT length for each dimension.
2704+
* @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform.
2705+
* @param <T> data type for {@code FFTND} output and operands
2706+
* @return a new instance of FFTND
2707+
*/
2708+
public <T extends TType> FFTND<T> fFTND(Operand<T> input, Operand<TInt32> fftLength,
2709+
Operand<TInt32> axes) {
2710+
return FFTND.create(scope, input, fftLength, axes);
2711+
}
2712+
26862713
/**
26872714
* Creates a tensor filled with a scalar value.
26882715
* This operation creates a tensor of shape {@code dims} and fills it with {@code value}.
@@ -3086,6 +3113,77 @@ public <U extends TNumber, T extends TNumber> HistogramFixedWidth<U> histogramFi
30863113
return HistogramFixedWidth.create(scope, values, valueRange, nbins, dtype);
30873114
}
30883115

3116+
/**
3117+
* ND inverse fast Fourier transform.
3118+
* Computes the n-dimensional inverse discrete Fourier transform over designated
3119+
* dimensions of {@code input}. The designated dimensions of {@code input} are assumed to be
3120+
* the result of {@code IFFTND}.
3121+
* <p>If fft_length[i]&lt;shape(input)[i], the input is cropped. If
3122+
* fft_length[i]&gt;shape(input)[i], the input is padded with zeros. If fft_length
3123+
* is not given, the default shape(input) is used.
3124+
* <p>Axes mean the dimensions to perform the transform on. Default is to perform on
3125+
* all axes.
3126+
*
3127+
* @param <T> data type for {@code output} output
3128+
* @param input A complex tensor.
3129+
* @param fftLength An int32 tensor. The FFT length for each dimension.
3130+
* @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform.
3131+
* @param <T> data type for {@code IFFTND} output and operands
3132+
* @return a new instance of IFFTND
3133+
*/
3134+
public <T extends TType> IFFTND<T> iFFTND(Operand<T> input, Operand<TInt32> fftLength,
3135+
Operand<TInt32> axes) {
3136+
return IFFTND.create(scope, input, fftLength, axes);
3137+
}
3138+
3139+
/**
3140+
* ND inverse real fast Fourier transform.
3141+
* Computes the n-dimensional inverse real discrete Fourier transform over
3142+
* designated dimensions of {@code input}. The designated dimensions of {@code input} are
3143+
* assumed to be the result of {@code IRFFTND}. The inner-most dimension contains the
3144+
* {@code fft_length / 2 + 1} unique components of the DFT of a real-valued signal.
3145+
* <p>If fft_length[i]&lt;shape(input)[i], the input is cropped. If
3146+
* fft_length[i]&gt;shape(input)[i], the input is padded with zeros. If fft_length
3147+
* is not given, the default shape(input) is used.
3148+
* <p>Axes mean the dimensions to perform the transform on. Default is to perform on
3149+
* all axes.
3150+
*
3151+
* @param <U> data type for {@code output} output
3152+
* @param input A complex tensor.
3153+
* @param fftLength An int32 tensor. The FFT length for each dimension.
3154+
* @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform.
3155+
* @return a new instance of IRFFTND, with default output types
3156+
*/
3157+
public IRFFTND<TFloat32> iRFFTND(Operand<? extends TType> input, Operand<TInt32> fftLength,
3158+
Operand<TInt32> axes) {
3159+
return IRFFTND.create(scope, input, fftLength, axes);
3160+
}
3161+
3162+
/**
3163+
* ND inverse real fast Fourier transform.
3164+
* Computes the n-dimensional inverse real discrete Fourier transform over
3165+
* designated dimensions of {@code input}. The designated dimensions of {@code input} are
3166+
* assumed to be the result of {@code IRFFTND}. The inner-most dimension contains the
3167+
* {@code fft_length / 2 + 1} unique components of the DFT of a real-valued signal.
3168+
* <p>If fft_length[i]&lt;shape(input)[i], the input is cropped. If
3169+
* fft_length[i]&gt;shape(input)[i], the input is padded with zeros. If fft_length
3170+
* is not given, the default shape(input) is used.
3171+
* <p>Axes mean the dimensions to perform the transform on. Default is to perform on
3172+
* all axes.
3173+
*
3174+
* @param <U> data type for {@code output} output
3175+
* @param input A complex tensor.
3176+
* @param fftLength An int32 tensor. The FFT length for each dimension.
3177+
* @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform.
3178+
* @param Treal The value of the Treal attribute
3179+
* @param <U> data type for {@code IRFFTND} output and operands
3180+
* @return a new instance of IRFFTND
3181+
*/
3182+
public <U extends TNumber> IRFFTND<U> iRFFTND(Operand<? extends TType> input,
3183+
Operand<TInt32> fftLength, Operand<TInt32> axes, Class<U> Treal) {
3184+
return IRFFTND.create(scope, input, fftLength, axes, Treal);
3185+
}
3186+
30893187
/**
30903188
* Return a tensor with the same shape and contents as the input tensor or value.
30913189
*
@@ -4219,6 +4317,31 @@ public <T extends TType> QuantizedReshape<T> quantizedReshape(Operand<T> tensor,
42194317
return QuantizedReshape.create(scope, tensor, shape, inputMin, inputMax);
42204318
}
42214319

4320+
/**
4321+
* ND fast real Fourier transform.
4322+
* Computes the n-dimensional real discrete Fourier transform over designated
4323+
* dimensions of {@code input}. The designated dimensions of {@code input} are assumed to be
4324+
* the result of {@code RFFTND}. The length of the last axis transformed will be
4325+
* fft_length[-1]//2+1.
4326+
* <p>If fft_length[i]&lt;shape(input)[i], the input is cropped. If
4327+
* fft_length[i]&gt;shape(input)[i], the input is padded with zeros. If fft_length
4328+
* is not given, the default shape(input) is used.
4329+
* <p>Axes mean the dimensions to perform the transform on. Default is to perform on
4330+
* all axes.
4331+
*
4332+
* @param <U> data type for {@code output} output
4333+
* @param input A complex tensor.
4334+
* @param fftLength An int32 tensor. The FFT length for each dimension.
4335+
* @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform.
4336+
* @param Tcomplex The value of the Tcomplex attribute
4337+
* @param <U> data type for {@code RFFTND} output and operands
4338+
* @return a new instance of RFFTND
4339+
*/
4340+
public <U extends TType> RFFTND<U> rFFTND(Operand<? extends TNumber> input,
4341+
Operand<TInt32> fftLength, Operand<TInt32> axes, Class<U> Tcomplex) {
4342+
return RFFTND.create(scope, input, fftLength, axes, Tcomplex);
4343+
}
4344+
42224345
/**
42234346
* The RaggedFillEmptyRows operation
42244347
*

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

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -905,12 +905,14 @@ public SparseReshape sparseReshape(Operand<TInt64> inputIndices, Operand<TInt64>
905905
* @param data The data value
906906
* @param indices A 1-D tensor. Has same rank as {@code segment_ids}.
907907
* @param segmentIds A 1-D tensor. Values should be sorted and can be repeated.
908+
* @param options carries optional attribute values
908909
* @param <T> data type for {@code SparseSegmentMean} output and operands
909910
* @return a new instance of SparseSegmentMean
910911
*/
911912
public <T extends TNumber> SparseSegmentMean<T> sparseSegmentMean(Operand<T> data,
912-
Operand<? extends TNumber> indices, Operand<? extends TNumber> segmentIds) {
913-
return SparseSegmentMean.create(scope, data, indices, segmentIds);
913+
Operand<? extends TNumber> indices, Operand<? extends TNumber> segmentIds,
914+
SparseSegmentMean.Options... options) {
915+
return SparseSegmentMean.create(scope, data, indices, segmentIds, options);
914916
}
915917

916918
/**
@@ -945,13 +947,14 @@ public <T extends TNumber> SparseSegmentMeanGrad<T> sparseSegmentMeanGrad(Operan
945947
* @param indices A 1-D tensor. Has same rank as {@code segment_ids}.
946948
* @param segmentIds A 1-D tensor. Values should be sorted and can be repeated.
947949
* @param numSegments Should equal the number of distinct segment IDs.
950+
* @param options carries optional attribute values
948951
* @param <T> data type for {@code SparseSegmentMeanWithNumSegments} output and operands
949952
* @return a new instance of SparseSegmentMeanWithNumSegments
950953
*/
951954
public <T extends TNumber> SparseSegmentMeanWithNumSegments<T> sparseSegmentMeanWithNumSegments(
952955
Operand<T> data, Operand<? extends TNumber> indices, Operand<? extends TNumber> segmentIds,
953-
Operand<? extends TNumber> numSegments) {
954-
return SparseSegmentMeanWithNumSegments.create(scope, data, indices, segmentIds, numSegments);
956+
Operand<? extends TNumber> numSegments, SparseSegmentMeanWithNumSegments.Options... options) {
957+
return SparseSegmentMeanWithNumSegments.create(scope, data, indices, segmentIds, numSegments, options);
955958
}
956959

957960
/**
@@ -963,12 +966,14 @@ public <T extends TNumber> SparseSegmentMeanWithNumSegments<T> sparseSegmentMean
963966
* @param data The data value
964967
* @param indices A 1-D tensor. Has same rank as {@code segment_ids}.
965968
* @param segmentIds A 1-D tensor. Values should be sorted and can be repeated.
969+
* @param options carries optional attribute values
966970
* @param <T> data type for {@code SparseSegmentSqrtN} output and operands
967971
* @return a new instance of SparseSegmentSqrtN
968972
*/
969973
public <T extends TNumber> SparseSegmentSqrtN<T> sparseSegmentSqrtN(Operand<T> data,
970-
Operand<? extends TNumber> indices, Operand<? extends TNumber> segmentIds) {
971-
return SparseSegmentSqrtN.create(scope, data, indices, segmentIds);
974+
Operand<? extends TNumber> indices, Operand<? extends TNumber> segmentIds,
975+
SparseSegmentSqrtN.Options... options) {
976+
return SparseSegmentSqrtN.create(scope, data, indices, segmentIds, options);
972977
}
973978

974979
/**
@@ -1004,13 +1009,15 @@ public <T extends TNumber> SparseSegmentSqrtNGrad<T> sparseSegmentSqrtNGrad(Oper
10041009
* @param indices A 1-D tensor. Has same rank as {@code segment_ids}.
10051010
* @param segmentIds A 1-D tensor. Values should be sorted and can be repeated.
10061011
* @param numSegments Should equal the number of distinct segment IDs.
1012+
* @param options carries optional attribute values
10071013
* @param <T> data type for {@code SparseSegmentSqrtNWithNumSegments} output and operands
10081014
* @return a new instance of SparseSegmentSqrtNWithNumSegments
10091015
*/
10101016
public <T extends TNumber> SparseSegmentSqrtNWithNumSegments<T> sparseSegmentSqrtNWithNumSegments(
10111017
Operand<T> data, Operand<? extends TNumber> indices, Operand<? extends TNumber> segmentIds,
1012-
Operand<? extends TNumber> numSegments) {
1013-
return SparseSegmentSqrtNWithNumSegments.create(scope, data, indices, segmentIds, numSegments);
1018+
Operand<? extends TNumber> numSegments,
1019+
SparseSegmentSqrtNWithNumSegments.Options... options) {
1020+
return SparseSegmentSqrtNWithNumSegments.create(scope, data, indices, segmentIds, numSegments, options);
10141021
}
10151022

10161023
/**
@@ -1046,12 +1053,14 @@ public <T extends TNumber> SparseSegmentSqrtNWithNumSegments<T> sparseSegmentSqr
10461053
* @param data The data value
10471054
* @param indices A 1-D tensor. Has same rank as {@code segment_ids}.
10481055
* @param segmentIds A 1-D tensor. Values should be sorted and can be repeated.
1056+
* @param options carries optional attribute values
10491057
* @param <T> data type for {@code SparseSegmentSum} output and operands
10501058
* @return a new instance of SparseSegmentSum
10511059
*/
10521060
public <T extends TNumber> SparseSegmentSum<T> sparseSegmentSum(Operand<T> data,
1053-
Operand<? extends TNumber> indices, Operand<? extends TNumber> segmentIds) {
1054-
return SparseSegmentSum.create(scope, data, indices, segmentIds);
1061+
Operand<? extends TNumber> indices, Operand<? extends TNumber> segmentIds,
1062+
SparseSegmentSum.Options... options) {
1063+
return SparseSegmentSum.create(scope, data, indices, segmentIds, options);
10551064
}
10561065

10571066
/**
@@ -1105,13 +1114,14 @@ public <T extends TNumber> SparseSegmentSumGrad<T> sparseSegmentSumGrad(Operand<
11051114
* @param indices A 1-D tensor. Has same rank as {@code segment_ids}.
11061115
* @param segmentIds A 1-D tensor. Values should be sorted and can be repeated.
11071116
* @param numSegments Should equal the number of distinct segment IDs.
1117+
* @param options carries optional attribute values
11081118
* @param <T> data type for {@code SparseSegmentSumWithNumSegments} output and operands
11091119
* @return a new instance of SparseSegmentSumWithNumSegments
11101120
*/
11111121
public <T extends TNumber> SparseSegmentSumWithNumSegments<T> sparseSegmentSumWithNumSegments(
11121122
Operand<T> data, Operand<? extends TNumber> indices, Operand<? extends TNumber> segmentIds,
1113-
Operand<? extends TNumber> numSegments) {
1114-
return SparseSegmentSumWithNumSegments.create(scope, data, indices, segmentIds, numSegments);
1123+
Operand<? extends TNumber> numSegments, SparseSegmentSumWithNumSegments.Options... options) {
1124+
return SparseSegmentSumWithNumSegments.create(scope, data, indices, segmentIds, numSegments, options);
11151125
}
11161126

11171127
/**

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

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737

3838
/**
3939
* Mutually accumulates multiple tensors of identical type and shape.
40+
* {@code is_stateless} means each op does not need control dependencies to other
41+
* collective ops. In this case, keys that are unique at runtime
42+
* (e.g. {@code instance_key}) should be used to distinguish collective groups.
4043
*
4144
* @param <T> data type for {@code data} output
4245
*/
@@ -91,6 +94,9 @@ public static <T extends TNumber> CollectiveGather<T> create(Scope scope, Operan
9194
if (opts.timeoutSeconds != null) {
9295
opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds);
9396
}
97+
if (opts.isStateless != null) {
98+
opBuilder.setAttr("is_stateless", opts.isStateless);
99+
}
94100
if (opts.NorderingToken != null) {
95101
opBuilder.setAttr("Nordering_token", opts.NorderingToken);
96102
}
@@ -119,6 +125,16 @@ public static Options timeoutSeconds(Float timeoutSeconds) {
119125
return new Options().timeoutSeconds(timeoutSeconds);
120126
}
121127

128+
/**
129+
* Sets the isStateless option.
130+
*
131+
* @param isStateless the isStateless option
132+
* @return this Options instance.
133+
*/
134+
public static Options isStateless(Boolean isStateless) {
135+
return new Options().isStateless(isStateless);
136+
}
137+
122138
/**
123139
* Sets the NorderingToken option.
124140
*
@@ -151,6 +167,8 @@ public static class Options {
151167

152168
private Float timeoutSeconds;
153169

170+
private Boolean isStateless;
171+
154172
private Long NorderingToken;
155173

156174
private Options() {
@@ -178,6 +196,17 @@ public Options timeoutSeconds(Float timeoutSeconds) {
178196
return this;
179197
}
180198

199+
/**
200+
* Sets the isStateless option.
201+
*
202+
* @param isStateless the isStateless option
203+
* @return this Options instance.
204+
*/
205+
public Options isStateless(Boolean isStateless) {
206+
this.isStateless = isStateless;
207+
return this;
208+
}
209+
181210
/**
182211
* Sets the NorderingToken option.
183212
*
@@ -234,8 +263,13 @@ public static class Inputs<T extends TNumber> extends RawOpInputs<CollectiveGath
234263
*/
235264
public final float timeoutSeconds;
236265

266+
/**
267+
* The isStateless attribute
268+
*/
269+
public final boolean isStateless;
270+
237271
public Inputs(GraphOperation op) {
238-
super(new CollectiveGather<>(op), op, Arrays.asList("T", "communication_hint", "timeout_seconds"));
272+
super(new CollectiveGather<>(op), op, Arrays.asList("T", "communication_hint", "timeout_seconds", "is_stateless"));
239273
int inputIndex = 0;
240274
input = (Operand<T>) op.input(inputIndex++);
241275
groupSize = (Operand<TInt32>) op.input(inputIndex++);
@@ -247,6 +281,7 @@ public Inputs(GraphOperation op) {
247281
T = op.attributes().getAttrType("T");
248282
communicationHint = op.attributes().getAttrString("communication_hint");
249283
timeoutSeconds = op.attributes().getAttrFloat("timeout_seconds");
284+
isStateless = op.attributes().getAttrBool("is_stateless");
250285
}
251286
}
252287
}

0 commit comments

Comments
 (0)