diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a56d64d08ce..e43d793064e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -139,55 +139,9 @@ jobs:
- name: Deploy native artifact
if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }}
- windows-x86_64:
- runs-on: windows-2022
- needs: prepare
- strategy:
- matrix:
- ext: [""] #, -gpu]
- steps:
- - name: Install environment
- shell: cmd
- run: |
- set "PATH=C:\msys64\usr\bin;%PATH%"
- python -m pip install numpy six
- set "EXT=${{ matrix.ext }}"
- echo %JAVA_HOME%
- - name: Configure Java
- uses: actions/setup-java@v5
- with:
- distribution: 'adopt'
- java-version: '11'
- - name: Checkout repository
- uses: actions/checkout@v6
- - name: Build project
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
- set "PATH=C:\msys64\usr\bin;%PATH%"
- echo Shorten work paths to prevent Bazel from reaching MAX_PATH limit
- mkdir C:\tmp
- set "TEST_TMPDIR=C:\tmp"
- set "TMPDIR=C:\tmp"
- set "TEMP=C:\tmp"
- set "TMP=C:\tmp"
- bash --version
- git --version
- cl
- call mvn -version
- echo ^
For Unicode, see the - * [https://www.tensorflow.org/tutorials/representation/unicode](Working with Unicode text) + * [https://www.tensorflow.org/text/guide/unicode](Working with Unicode text) * tutorial. *
Examples: *
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java index f3fa3e6bbc0..896bb62de5c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java @@ -32,6 +32,7 @@ import org.tensorflow.op.image.DecodeImage; import org.tensorflow.op.image.DecodeJpeg; import org.tensorflow.op.image.DecodePng; +import org.tensorflow.op.image.DecodeWebP; import org.tensorflow.op.image.DrawBoundingBoxes; import org.tensorflow.op.image.EncodeJpeg; import org.tensorflow.op.image.EncodeJpegVariableQuality; @@ -336,17 +337,18 @@ public DecodeGif decodeGif(Operandcontents) { } /** - * Function for decode_bmp, decode_gif, decode_jpeg, and decode_png. - * Detects whether an image is a BMP, GIF, JPEG, or PNG, and performs the + * Function for decode_bmp, decode_gif, decode_jpeg, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, WebP, or PNG, and performs the * appropriate operation to convert the input bytes string into a Tensor of type * dtype. - * NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as - * opposed to decode_bmp, decode_jpeg and decode_png, which return 3-D arrays - * [height, width, num_channels]. Make sure to take this into account when - * constructing your graph if you are intermixing GIF files with BMP, JPEG, and/or - * PNG files. Alternately, set the expand_animations argument of this function to - * False, in which case the op will return 3-dimensional tensors and will truncate - * animated GIF files to the first frame. + *
NOTE: decode_gif and decode_webp return a 4-D + * array [num_frames, height, width, 3], as opposed to decode_bmp, + * decode_jpeg, and decode_png, which always return 3-D arrays [height, + * width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing animated files with + * BMP, JPEG, and/or PNG files. Alternately, set the expand_animations + * argument of this function to False, in which case the op will return + * 3-dimensional tensors and will truncate animations to the first frame. *
NOTE: If the first frame of an animated GIF does not occupy the entire * canvas (maximum frame width x maximum frame height), then it fills the * unoccupied areas (in the first frame) with zeros (black). For frames after the @@ -357,22 +359,24 @@ public DecodeGif decodeGif(Operand
contents) { * @param options carries optional attribute values * @return a new instance of DecodeImage, with default output types */ - public DecodeImage decodeImage(Operand contents, DecodeImage.Options[] options) { + public DecodeImage decodeImage(Operand contents, + DecodeImage.Options... options) { return DecodeImage.create(scope, contents, options); } /** - * Function for decode_bmp, decode_gif, decode_jpeg, and decode_png. - * Detects whether an image is a BMP, GIF, JPEG, or PNG, and performs the + * Function for decode_bmp, decode_gif, decode_jpeg, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, WebP, or PNG, and performs the * appropriate operation to convert the input bytes string into a Tensor of type * dtype. - * NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as - * opposed to decode_bmp, decode_jpeg and decode_png, which return 3-D arrays - * [height, width, num_channels]. Make sure to take this into account when - * constructing your graph if you are intermixing GIF files with BMP, JPEG, and/or - * PNG files. Alternately, set the expand_animations argument of this function to - * False, in which case the op will return 3-dimensional tensors and will truncate - * animated GIF files to the first frame. + *
NOTE: decode_gif and decode_webp return a 4-D + * array [num_frames, height, width, 3], as opposed to decode_bmp, + * decode_jpeg, and decode_png, which always return 3-D arrays [height, + * width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing animated files with + * BMP, JPEG, and/or PNG files. Alternately, set the expand_animations + * argument of this function to False, in which case the op will return + * 3-dimensional tensors and will truncate animations to the first frame. *
NOTE: If the first frame of an animated GIF does not occupy the entire * canvas (maximum frame width x maximum frame height), then it fills the * unoccupied areas (in the first frame) with zeros (black). For frames after the @@ -436,7 +440,7 @@ public DecodeJpeg decodeJpeg(Operand
contents, DecodeJpeg.Options... op * @param options carries optional attribute values * @return a new instance of DecodePng, with default output types */ - public DecodePng decodePng(Operand contents, DecodePng.Options[] options) { + public DecodePng decodePng(Operand contents, DecodePng.Options... options) { return DecodePng.create(scope, contents, options); } @@ -467,6 +471,51 @@ public DecodePng decodePng(Operand contents, Cla return DecodePng.create(scope, contents, dtype, options); } + /** + * Decode a WebP-encoded image to a uint8 tensor. + * The attr {@code channels} indicates the desired number of color channels for the + * decoded image. + * Accepted values are: + *
+ *
+ *- 0: Use the number of channels in the WebP-encoded image.
+ *- 3: output an RGB image.
+ *- 4: output an RGBA image.
+ *The number of channels must currently match that of the underlying file. + * For WebP animations, only 4-channel RGBA is supported. + * + * @param contents 0-D. The WebP-encoded image. + * @param options carries optional attribute values + * @return a new instance of DecodeWebP, with default output types + */ + public DecodeWebP
decodeWebP(Operand contents, DecodeWebP.Options... options) { + return DecodeWebP.create(scope, contents, options); + } + + /** + * Decode a WebP-encoded image to a uint8 tensor. + * The attr {@code channels} indicates the desired number of color channels for the + * decoded image. + * Accepted values are: + *
+ *
+ *- 0: Use the number of channels in the WebP-encoded image.
+ *- 3: output an RGB image.
+ *- 4: output an RGBA image.
+ *The number of channels must currently match that of the underlying file. + * For WebP animations, only 4-channel RGBA is supported. + * + * @param contents 0-D. The WebP-encoded image. + * @param dtype The value of the dtype attribute + * @param options carries optional attribute values + * @param
data type for {@code DecodeWebP} output and operands + * @return a new instance of DecodeWebP + */ + public DecodeWebP decodeWebP(Operand contents, Class dtype, + DecodeWebP.Options... options) { + return DecodeWebP.create(scope, contents, dtype, options); + } + /** * Draw bounding boxes on a batch of images. * Outputs a copy of {@code images} but draws on top of the pixels zero or more bounding diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java index 535af3cda71..c9f086a3255 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java @@ -2127,7 +2127,7 @@ public MaxPoolGradWithArgmax maxPoolGradWithArgmax(Operan * @return a new instance of MaxPoolWithArgmax, with default output types */ public MaxPoolWithArgmax maxPoolWithArgmax(Operand input, - List ksize, List strides, String padding, MaxPoolWithArgmax.Options[] options) { + List ksize, List strides, String padding, MaxPoolWithArgmax.Options... options) { return MaxPoolWithArgmax.create(scope, input, ksize, strides, padding, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java index b9f5cd836f6..8483a4efb61 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java @@ -420,10 +420,10 @@ public final class Ops { public final SummaryOps summary; - public final ImageOps image; - public final RaggedOps ragged; + public final ImageOps image; + public final ShapeOps shape; public final IoOps io; @@ -457,8 +457,8 @@ public final class Ops { train = new TrainOps(this); quantization = new QuantizationOps(this); summary = new SummaryOps(this); - image = new ImageOps(this); ragged = new RaggedOps(this); + image = new ImageOps(this); shape = new ShapeOps(this); io = new IoOps(this); dtypes = new DtypesOps(this); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java index 8bd174ba427..88df6bf8a0e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java @@ -114,7 +114,7 @@ public final class QuantizationOps { * @return a new instance of Dequantize, with default output types */ public Dequantize dequantize(Operand extends TNumber> input, - Operand minRange, Operand maxRange, Dequantize.Options[] options) { + Operand minRange, Operand maxRange, Dequantize.Options... options) { return Dequantize.create(scope, input, minRange, maxRange, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java index c5ff9a489a0..6000af11c9b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java @@ -210,7 +210,7 @@ public LogUniformCandidateSampler logUniformCandidateSampler(Operand tru * @return a new instance of Multinomial, with default output types */ public Multinomial multinomial(Operand extends TNumber> logits, - Operand numSamples, Multinomial.Options[] options) { + Operand numSamples, Multinomial.Options... options) { return Multinomial.create(scope, logits, numSamples, options); } @@ -327,7 +327,7 @@ public RandomGammaGrad randomGammaGrad(Operand alpha, * @return a new instance of RandomPoisson, with default output types */ public RandomPoisson randomPoisson(Operand extends TNumber> shape, - Operand extends TNumber> rate, RandomPoisson.Options[] options) { + Operand extends TNumber> rate, RandomPoisson.Options... options) { return RandomPoisson.create(scope, shape, rate, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java index 56a82c2dbf6..2b49dd474a3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java @@ -564,7 +564,7 @@ public ToNumber toNumber(Operand stringTensor, C * @return a new instance of UnicodeDecode, with default output types */ public UnicodeDecode unicodeDecode(Operand input, String inputEncoding, - UnicodeDecode.Options[] options) { + UnicodeDecode.Options... options) { return UnicodeDecode.create(scope, input, inputEncoding, options); } @@ -626,7 +626,7 @@ public UnicodeDecode unicodeDecode(Operand input * @return a new instance of UnicodeDecodeWithOffsets, with default output types */ public UnicodeDecodeWithOffsets unicodeDecodeWithOffsets(Operand input, - String inputEncoding, UnicodeDecodeWithOffsets.Options[] options) { + String inputEncoding, UnicodeDecodeWithOffsets.Options... options) { return UnicodeDecodeWithOffsets.create(scope, input, inputEncoding, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java index 22a2ef5ae85..38961e1570a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java @@ -28,12 +28,18 @@ import org.tensorflow.op.xla.XlaHostCompute; import org.tensorflow.op.xla.XlaRecvFromHost; import org.tensorflow.op.xla.XlaSendToHost; +import org.tensorflow.op.xla.XlaSparseActivationsUnstack; import org.tensorflow.op.xla.XlaSparseCoreAdagrad; import org.tensorflow.op.xla.XlaSparseCoreAdagradMomentum; import org.tensorflow.op.xla.XlaSparseCoreAdam; import org.tensorflow.op.xla.XlaSparseCoreFtrl; import org.tensorflow.op.xla.XlaSparseCoreSgd; import org.tensorflow.op.xla.XlaSparseDenseMatmul; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput; import org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdagradAndCsrInput; import org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput; import org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdamAndCsrInput; @@ -42,6 +48,7 @@ import org.tensorflow.op.xla.XlaSparseDenseMatmulWithCsrInput; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** @@ -292,6 +299,24 @@ public XlaSendToHost xlaSendToHost(Operand extends TType> input, String key) { return XlaSendToHost.create(scope, input, key); } + /** + * The XlaSparseActivationsUnstack operation + * + * @param stackedActivations The stackedActivations value + * @param numTables The value of the numTables attribute + * @param sampleCounts The value of the sampleCounts attribute + * @param features The value of the features attribute + * @param interleaved The value of the interleaved attribute + * @param dtype The value of the dtype attribute + * @param data type for {@code XlaSparseActivationsUnstack} output and operands + * @return a new instance of XlaSparseActivationsUnstack + */ + public XlaSparseActivationsUnstack xlaSparseActivationsUnstack( + Operand extends TType> stackedActivations, Long numTables, List sampleCounts, + List features, Boolean interleaved, Class dtype) { + return XlaSparseActivationsUnstack.create(scope, stackedActivations, numTables, sampleCounts, features, interleaved, dtype); + } + /** * The XlaSparseCoreAdagrad operation * @@ -418,6 +443,217 @@ public XlaSparseDenseMatmul xlaSparseDenseMatmul(Operand rowIds, return XlaSparseDenseMatmul.create(scope, rowIds, colIds, values, offsets, embeddingTable, maxIdsPerPartition, maxUniqueIdsPerPartition, inputSize); } + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand accumulator, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, learningRate, combinerWeightsLearningRate, embeddingTable, accumulator, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, tableName, options); + } + + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param momenta The momenta value + * @param useNesterov The value of the useNesterov attribute + * @param exponent The value of the exponent attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand accumulator, Operand momenta, + Boolean useNesterov, Float exponent, Float beta1, Float beta2, Float epsilon, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, learningRate, combinerWeightsLearningRate, embeddingTable, accumulator, momenta, useNesterov, exponent, beta1, beta2, epsilon, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, tableName, options); + } + + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param momenta The momenta value + * @param velocity The velocity value + * @param useSumInsideSqrt The value of the useSumInsideSqrt attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand momenta, Operand velocity, + Boolean useSumInsideSqrt, Float beta1, Float beta2, Float epsilon, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, learningRate, combinerWeightsLearningRate, embeddingTable, momenta, velocity, useSumInsideSqrt, beta1, beta2, epsilon, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, tableName, options); + } + + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param tables The tables value + * @param hyperparameters The hyperparameters value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param optimizerCustomComputation The value of the optimizerCustomComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Iterable > tables, Iterable > hyperparameters, + Operand combinerWeightsLearningRate, Long maxValency, Long numWeights, + ConcreteFunction combinerTableVjpComputation, ConcreteFunction combinerWeightsVjpComputation, + ConcreteFunction optimizerCustomComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, tables, hyperparameters, combinerWeightsLearningRate, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, optimizerCustomComputation, tableName, options); + } + + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param linear The linear value + * @param multiplyLinearByLearningRate The value of the multiplyLinearByLearningRate attribute + * @param beta The value of the beta attribute + * @param learningRatePower The value of the learningRatePower attribute + * @param l1RegularizationStrength The value of the l1RegularizationStrength attribute + * @param l2RegularizationStrength The value of the l2RegularizationStrength attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand accumulator, Operand linear, + Boolean multiplyLinearByLearningRate, Float beta, Float learningRatePower, + Float l1RegularizationStrength, Float l2RegularizationStrength, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, learningRate, combinerWeightsLearningRate, embeddingTable, accumulator, linear, multiplyLinearByLearningRate, beta, learningRatePower, l1RegularizationStrength, l2RegularizationStrength, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, tableName, options); + } + /** * The XlaSparseDenseMatmulGradWithAdagradAndCsrInput operation * @@ -579,15 +815,17 @@ public XlaSparseDenseMatmulGradWithSgdAndCsrInput xlaSparseDenseMatmulGradWithSg * @param quantizationConfigHigh The value of the quantizationConfigHigh attribute * @param quantizationConfigNumBuckets The value of the quantizationConfigNumBuckets attribute * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @param data type for {@code XlaSparseDenseMatmulWithCsrInput} output and operands * @return a new instance of XlaSparseDenseMatmulWithCsrInput */ - public XlaSparseDenseMatmulWithCsrInput xlaSparseDenseMatmulWithCsrInput( + public XlaSparseDenseMatmulWithCsrInput xlaSparseDenseMatmulWithCsrInput( Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, - Operand sortedGains, Operand embeddingTable, + Operand sortedGains, Operand embeddingTable, Operand numMinibatchesPerPhysicalSparseCore, Long inputSize, Float quantizationConfigLow, Float quantizationConfigHigh, Long quantizationConfigNumBuckets, - String tableName) { - return XlaSparseDenseMatmulWithCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedGains, embeddingTable, numMinibatchesPerPhysicalSparseCore, inputSize, quantizationConfigLow, quantizationConfigHigh, quantizationConfigNumBuckets, tableName); + String tableName, XlaSparseDenseMatmulWithCsrInput.Options... options) { + return XlaSparseDenseMatmulWithCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedGains, embeddingTable, numMinibatchesPerPhysicalSparseCore, inputSize, quantizationConfigLow, quantizationConfigHigh, quantizationConfigNumBuckets, tableName, options); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java index 4ff0f11c7bc..d83f728b452 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java @@ -102,7 +102,7 @@ public static DebugNumericsSummary create(Scope scope, describeByClass = true ) public static DebugNumericsSummary create(Scope scope, Operand extends TType> input, - Options[] options) { + Options... options) { return create(scope, input, TFloat32.class, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java index 1f9b0285c6c..25dfbfe50ff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java @@ -38,7 +38,7 @@ * Converts each entry in the given tensor to strings. * Supports many numeric types and boolean. * For Unicode, see the - * [https://www.tensorflow.org/tutorials/representation/unicode](Working with Unicode text) + * [https://www.tensorflow.org/text/guide/unicode](Working with Unicode text) * tutorial. *
Examples: *
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java index a5c7ee7845e..891c31bb514 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java @@ -37,17 +37,18 @@ import org.tensorflow.types.family.TNumber; /** - * Function for decode_bmp, decode_gif, decode_jpeg, and decode_png. - * Detects whether an image is a BMP, GIF, JPEG, or PNG, and performs the + * Function for decode_bmp, decode_gif, decode_jpeg, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, WebP, or PNG, and performs the * appropriate operation to convert the input bytes string into a Tensor of type * dtype. - *NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as - * opposed to decode_bmp, decode_jpeg and decode_png, which return 3-D arrays - * [height, width, num_channels]. Make sure to take this into account when - * constructing your graph if you are intermixing GIF files with BMP, JPEG, and/or - * PNG files. Alternately, set the expand_animations argument of this function to - * False, in which case the op will return 3-dimensional tensors and will truncate - * animated GIF files to the first frame. + *
NOTE: decode_gif and decode_webp return a 4-D + * array [num_frames, height, width, 3], as opposed to decode_bmp, + * decode_jpeg, and decode_png, which always return 3-D arrays [height, + * width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing animated files with + * BMP, JPEG, and/or PNG files. Alternately, set the expand_animations + * argument of this function to False, in which case the op will return + * 3-dimensional tensors and will truncate animations to the first frame. *
NOTE: If the first frame of an animated GIF does not occupy the entire * canvas (maximum frame width x maximum frame height), then it fills the * unoccupied areas (in the first frame) with zeros (black). For frames after the @@ -118,7 +119,7 @@ public static
DecodeImage create(Scope scope, Operand create(Scope scope, Operand contents, - Options[] options) { + Options... options) { return create(scope, contents, TUint8.class, options); } @@ -135,10 +136,11 @@ public static Options channels(Long channels) { /** * Sets the expandAnimations option. * - * @param expandAnimations Controls the output shape of the returned op. If True, the returned op will - * produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all - * GIFs, whether animated or not. If, False, the returned op will produce a 3-D - * tensor for all file types and will truncate animated GIFs to the first frame. + * @param expandAnimations Controls the output shape of the returned op. If True, the returned op + * will produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D + * tensor for all GIFs and WebP images, whether animated or not. If, + * False, the returned op will produce a 3-D tensor for all file types + * and will truncate animated images to the first frame. * @return this Options instance. */ public static Options expandAnimations(Boolean expandAnimations) { @@ -185,10 +187,11 @@ public Options channels(Long channels) { /** * Sets the expandAnimations option. * - * @param expandAnimations Controls the output shape of the returned op. If True, the returned op will - * produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all - * GIFs, whether animated or not. If, False, the returned op will produce a 3-D - * tensor for all file types and will truncate animated GIFs to the first frame. + * @param expandAnimations Controls the output shape of the returned op. If True, the returned op + * will produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D + * tensor for all GIFs and WebP images, whether animated or not. If, + * False, the returned op will produce a 3-D tensor for all file types + * and will truncate animated images to the first frame. * @return this Options instance. */ public Options expandAnimations(Boolean expandAnimations) { @@ -217,10 +220,11 @@ public static class Inputs extends RawOpInputs > { public final DataType dtype; /** - * Controls the output shape of the returned op. If True, the returned op will - * produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all - * GIFs, whether animated or not. If, False, the returned op will produce a 3-D - * tensor for all file types and will truncate animated GIFs to the first frame. + * Controls the output shape of the returned op. If True, the returned op + * will produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D + * tensor for all GIFs and WebP images, whether animated or not. If, + * False, the returned op will produce a 3-D tensor for all file types + * and will truncate animated images to the first frame. */ public final boolean expandAnimations; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java index dd6384caf7c..8352476fae0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java @@ -113,7 +113,7 @@ public static DecodePng create(Scope scope, Operand create(Scope scope, Operand contents, - Options[] options) { + Options... options) { return create(scope, contents, TUint8.class, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeWebP.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeWebP.java new file mode 100644 index 00000000000..16a7b6b54cb --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeWebP.java @@ -0,0 +1,189 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.image; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUint8; +import org.tensorflow.types.family.TNumber; + +/** + * Decode a WebP-encoded image to a uint8 tensor. + * The attr {@code channels} indicates the desired number of color channels for the + * decoded image. + * Accepted values are: + *
+ *
+ *- 0: Use the number of channels in the WebP-encoded image.
+ *- 3: output an RGB image.
+ *- 4: output an RGBA image.
+ *The number of channels must currently match that of the underlying file. + * For WebP animations, only 4-channel RGBA is supported. + */ +@OpMetadata( + opType = DecodeWebP.OP_NAME, + inputsClass = DecodeWebP.Inputs.class +) +@Operator( + group = "image" +) +public final class DecodeWebP
extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DecodeWebP"; + + private Output image; + + public DecodeWebP(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + image = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DecodeWebP operation. + * + * @param scope current scope + * @param contents 0-D. The WebP-encoded image. + * @param dtype The value of the dtype attribute + * @param options carries optional attribute values + * @param data type for {@code DecodeWebP} output and operands + * @return a new instance of DecodeWebP + */ + @Endpoint( + describeByClass = true + ) + public static DecodeWebP create(Scope scope, Operand contents, + Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeWebP"); + opBuilder.addInput(contents.asOutput()); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + if (options != null) { + for (Options opts : options) { + if (opts.channels != null) { + opBuilder.setAttr("channels", opts.channels); + } + } + } + return new DecodeWebP<>(opBuilder.build()); + } + + /** + * Factory method to create a class wrapping a new DecodeWebP operation, with the default output types. + * + * @param scope current scope + * @param contents 0-D. The WebP-encoded image. + * @param options carries optional attribute values + * @return a new instance of DecodeWebP, with default output types + */ + @Endpoint( + describeByClass = true + ) + public static DecodeWebP create(Scope scope, Operand contents, + Options... options) { + return create(scope, contents, TUint8.class, options); + } + + /** + * Sets the channels option. + * + * @param channels Number of color channels for the decoded image. + * @return this Options instance. + */ + public static Options channels(Long channels) { + return new Options().channels(channels); + } + + /** + * Gets image. + * 4-D with shape {@code [num_frames, height, width, channels]}. + * @return image. + */ + public Output image() { + return image; + } + + @Override + public Output asOutput() { + return image; + } + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeWebP} + */ + public static class Options { + private Long channels; + + private Options() { + } + + /** + * Sets the channels option. + * + * @param channels Number of color channels for the decoded image. + * @return this Options instance. + */ + public Options channels(Long channels) { + this.channels = channels; + return this; + } + } + + @OpInputsMetadata( + outputsClass = DecodeWebP.class + ) + public static class Inputs extends RawOpInputs > { + /** + * 0-D. The WebP-encoded image. + */ + public final Operand contents; + + /** + * Number of color channels for the decoded image. + */ + public final long channels; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new DecodeWebP<>(op), op, Arrays.asList("channels", "dtype")); + int inputIndex = 0; + contents = (Operand ) op.input(inputIndex++); + channels = op.attributes().getAttrInt("channels"); + dtype = op.attributes().getAttrType("dtype"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java index bd19af1b703..78e871d2de7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java @@ -133,7 +133,7 @@ public static MaxPoolWithArgmax cre describeByClass = true ) public static MaxPoolWithArgmax create(Scope scope, - Operand input, List ksize, List strides, String padding, Options[] options) { + Operand input, List ksize, List strides, String padding, Options... options) { return create(scope, input, ksize, strides, TInt64.class, padding, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java index a062ee1db29..e1333747ce9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java @@ -156,7 +156,7 @@ public static Dequantize create(Scope scope, describeByClass = true ) public static Dequantize create(Scope scope, Operand extends TNumber> input, - Operand minRange, Operand maxRange, Options[] options) { + Operand minRange, Operand maxRange, Options... options) { return create(scope, input, minRange, maxRange, TFloat32.class, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java index a213609fca6..c4625651dc9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java @@ -109,7 +109,7 @@ public static Multinomial create(Scope scope, describeByClass = true ) public static Multinomial create(Scope scope, Operand extends TNumber> logits, - Operand numSamples, Options[] options) { + Operand numSamples, Options... options) { return create(scope, logits, numSamples, TInt64.class, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java index 3e5fc40fc2f..8abad16a003 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java @@ -118,7 +118,7 @@ public static RandomPoisson create(Scope scope, describeByClass = true ) public static RandomPoisson create(Scope scope, Operand extends TNumber> shape, - Operand extends TNumber> rate, Options[] options) { + Operand extends TNumber> rate, Options... options) { return create(scope, shape, rate, TInt64.class, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java index 40624c66adf..cc29b554bef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java @@ -130,7 +130,7 @@ public static UnicodeDecode create(Scope scope, Operand create(Scope scope, Operand input, - String inputEncoding, Options[] options) { + String inputEncoding, Options... options) { return create(scope, input, inputEncoding, TInt64.class, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java index 5989e8e7106..fb8887c4594 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java @@ -137,7 +137,7 @@ public static UnicodeDecodeWithOffsets create(Scope scope describeByClass = true ) public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, - String inputEncoding, Options[] options) { + String inputEncoding, Options... options) { return create(scope, input, inputEncoding, TInt64.class, options); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java index 67f49871a2c..3e9453b7789 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java @@ -113,6 +113,9 @@ public static ReplicateMetadata create(Scope scope, Long numReplicas, Options... if (opts.useSpmdForXlaPartitioning != null) { opBuilder.setAttr("use_spmd_for_xla_partitioning", opts.useSpmdForXlaPartitioning); } + if (opts.useShardyPartitioner != null) { + opBuilder.setAttr("use_shardy_partitioner", opts.useShardyPartitioner); + } if (opts.tpuCompileOptionsProto != null) { opBuilder.setAttr("tpu_compile_options_proto", opts.tpuCompileOptionsProto); } @@ -261,6 +264,16 @@ public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitionin return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); } + /** + * Sets the useShardyPartitioner option. + * + * @param useShardyPartitioner the useShardyPartitioner option + * @return this Options instance. + */ + public static Options useShardyPartitioner(Boolean useShardyPartitioner) { + return new Options().useShardyPartitioner(useShardyPartitioner); + } + /** * Sets the tpuCompileOptionsProto option. * @@ -295,6 +308,8 @@ public static class Options { private Boolean useSpmdForXlaPartitioning; + private Boolean useShardyPartitioner; + private String tpuCompileOptionsProto; private Options() { @@ -454,6 +469,17 @@ public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { return this; } + /** + * Sets the useShardyPartitioner option. + * + * @param useShardyPartitioner the useShardyPartitioner option + * @return this Options instance. + */ + public Options useShardyPartitioner(Boolean useShardyPartitioner) { + this.useShardyPartitioner = useShardyPartitioner; + return this; + } + /** * Sets the tpuCompileOptionsProto option. * @@ -525,13 +551,18 @@ public static class Inputs extends RawOpInputs { */ public final boolean useSpmdForXlaPartitioning; + /** + * The useShardyPartitioner attribute + */ + public final boolean useShardyPartitioner; + /** * The tpuCompileOptionsProto attribute */ public final String tpuCompileOptionsProto; public Inputs(GraphOperation op) { - super(new ReplicateMetadata(op), op, Arrays.asList("num_replicas", "num_cores_per_replica", "topology", "use_tpu", "device_assignment", "computation_shape", "host_compute_core", "padding_map", "step_marker_location", "allow_soft_placement", "use_spmd_for_xla_partitioning", "tpu_compile_options_proto")); + super(new ReplicateMetadata(op), op, Arrays.asList("num_replicas", "num_cores_per_replica", "topology", "use_tpu", "device_assignment", "computation_shape", "host_compute_core", "padding_map", "step_marker_location", "allow_soft_placement", "use_spmd_for_xla_partitioning", "use_shardy_partitioner", "tpu_compile_options_proto")); int inputIndex = 0; numReplicas = op.attributes().getAttrInt("num_replicas"); numCoresPerReplica = op.attributes().getAttrInt("num_cores_per_replica"); @@ -544,6 +575,7 @@ public Inputs(GraphOperation op) { stepMarkerLocation = op.attributes().getAttrString("step_marker_location"); allowSoftPlacement = op.attributes().getAttrBool("allow_soft_placement"); useSpmdForXlaPartitioning = op.attributes().getAttrBool("use_spmd_for_xla_partitioning"); + useShardyPartitioner = op.attributes().getAttrBool("use_shardy_partitioner"); tpuCompileOptionsProto = op.attributes().getAttrString("tpu_compile_options_proto"); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUDummyInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUDummyInput.java new file mode 100644 index 00000000000..4b7fae6c11c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUDummyInput.java @@ -0,0 +1,114 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; + +/** + * Generates a zero-valued tensor for use as a dummy input to a TPU. + * For the internal use of the TF2XLA bridge in the XLA Broadcast pass. This op + */ +@OpMetadata( + opType = TPUDummyInput.OP_NAME, + inputsClass = TPUDummyInput.Inputs.class +) +public final class TPUDummyInput extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUDummyInput"; + + private Output output; + + public TPUDummyInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TPUDummyInput operation. + * + * @param scope current scope + * @param dtype The element type of the produced tensor. + * @param shape The shape of the produced tensor. + * @param data type for {@code TPUDummyInput} output and operands + * @return a new instance of TPUDummyInput + */ + @Endpoint( + describeByClass = true + ) + public static TPUDummyInput create(Scope scope, Class dtype, + Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUDummyInput"); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + opBuilder.setAttr("shape", shape); + return new TPUDummyInput<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = TPUDummyInput.class + ) + public static class Inputs extends RawOpInputs > { + /** + * The element type of the produced tensor. + */ + public final DataType dtype; + + /** + * The shape of the produced tensor. + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new TPUDummyInput<>(op), op, Arrays.asList("dtype", "shape")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java index 1e5fab82839..968dde2b09a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java @@ -116,6 +116,9 @@ public static TPUReplicateMetadata create(Scope scope, Long numReplicas, Options if (opts.useSpmdForXlaPartitioning != null) { opBuilder.setAttr("use_spmd_for_xla_partitioning", opts.useSpmdForXlaPartitioning); } + if (opts.useShardyPartitioner != null) { + opBuilder.setAttr("use_shardy_partitioner", opts.useShardyPartitioner); + } if (opts.tpuCompileOptionsProto != null) { opBuilder.setAttr("tpu_compile_options_proto", opts.tpuCompileOptionsProto); } @@ -264,6 +267,16 @@ public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitionin return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); } + /** + * Sets the useShardyPartitioner option. + * + * @param useShardyPartitioner the useShardyPartitioner option + * @return this Options instance. + */ + public static Options useShardyPartitioner(Boolean useShardyPartitioner) { + return new Options().useShardyPartitioner(useShardyPartitioner); + } + /** * Sets the tpuCompileOptionsProto option. * @@ -298,6 +311,8 @@ public static class Options { private Boolean useSpmdForXlaPartitioning; + private Boolean useShardyPartitioner; + private String tpuCompileOptionsProto; private Options() { @@ -457,6 +472,17 @@ public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { return this; } + /** + * Sets the useShardyPartitioner option. + * + * @param useShardyPartitioner the useShardyPartitioner option + * @return this Options instance. + */ + public Options useShardyPartitioner(Boolean useShardyPartitioner) { + this.useShardyPartitioner = useShardyPartitioner; + return this; + } + /** * Sets the tpuCompileOptionsProto option. * @@ -528,13 +554,18 @@ public static class Inputs extends RawOpInputs { */ public final boolean useSpmdForXlaPartitioning; + /** + * The useShardyPartitioner attribute + */ + public final boolean useShardyPartitioner; + /** * The tpuCompileOptionsProto attribute */ public final String tpuCompileOptionsProto; public Inputs(GraphOperation op) { - super(new TPUReplicateMetadata(op), op, Arrays.asList("num_replicas", "num_cores_per_replica", "topology", "use_tpu", "device_assignment", "computation_shape", "host_compute_core", "padding_map", "step_marker_location", "allow_soft_placement", "use_spmd_for_xla_partitioning", "tpu_compile_options_proto")); + super(new TPUReplicateMetadata(op), op, Arrays.asList("num_replicas", "num_cores_per_replica", "topology", "use_tpu", "device_assignment", "computation_shape", "host_compute_core", "padding_map", "step_marker_location", "allow_soft_placement", "use_spmd_for_xla_partitioning", "use_shardy_partitioner", "tpu_compile_options_proto")); int inputIndex = 0; numReplicas = op.attributes().getAttrInt("num_replicas"); numCoresPerReplica = op.attributes().getAttrInt("num_cores_per_replica"); @@ -547,6 +578,7 @@ public Inputs(GraphOperation op) { stepMarkerLocation = op.attributes().getAttrString("step_marker_location"); allowSoftPlacement = op.attributes().getAttrBool("allow_soft_placement"); useSpmdForXlaPartitioning = op.attributes().getAttrBool("use_spmd_for_xla_partitioning"); + useShardyPartitioner = op.attributes().getAttrBool("use_shardy_partitioner"); tpuCompileOptionsProto = op.attributes().getAttrString("tpu_compile_options_proto"); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseActivationsUnstack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseActivationsUnstack.java new file mode 100644 index 00000000000..6dc42362b87 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseActivationsUnstack.java @@ -0,0 +1,163 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.xla; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * The XlaSparseActivationsUnstack operation + */ +@OpMetadata( + opType = XlaSparseActivationsUnstack.OP_NAME, + inputsClass = XlaSparseActivationsUnstack.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseActivationsUnstack extends RawOp implements Iterable > { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseActivationsUnstack"; + + private List