- View on TensorFlow.org
- |
-
- View GitHub repository
- |
-
||g'
+
+rm ${OUTPUT_DIR}/timestamp.js || true
+rm ${OUTPUT_DIR}/lists.js || true
+rm ${OUTPUT_DIR}/index.html || true
+
+cp ${TEMPLATES}/screen.css ${OUTPUT_DIR}/
+
+
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
new file mode 100644
index 00000000000..8729bca5af5
--- /dev/null
+++ b/docs/mkdocs.yml
@@ -0,0 +1,49 @@
+site_name: ''
+site_url: https://tensorflow.org
+repo_url: https://github.com/tensorflow/java
+site_description: Documentation of TensorFlow Java API and tools.
+copyright: "© TensorFlow Authors 2025"
+
+theme:
+ name: material
+ logo: assets/tensorflow.svg
+ features:
+ - navigation.indexes
+ - navigation.instant
+ - navigation.sections
+ - navigation.tabs
+ - navigation.tabs.sticky
+ - toc.follow
+ palette:
+ # Palette toggle for automatic mode
+ - media: "(prefers-color-scheme)"
+ toggle:
+ icon: material/brightness-auto
+ name: Switch to light mode
+ # Palette toggle for light mode
+ - media: "(prefers-color-scheme: light)"
+ scheme: default
+ primary: white
+ accent: orange
+ toggle:
+ icon: material/brightness-7
+ name: Switch to dark mode
+ # Palette toggle for dark mode
+ - media: "(prefers-color-scheme: dark)"
+ scheme: slate
+ primary: black
+ accent: orange
+ toggle:
+ icon: material/brightness-4
+ name: Switch to system preference
+
+extra_css:
+ - stylesheets/extra.css
+
+nav:
+ - Home:
+ - index.md
+ - Install:
+ - install.md
+ - References:
+ - apidocs/index.html
diff --git a/pom.xml b/pom.xml
index 41d80cf24fa..cd986f316a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
org.tensorflow
tensorflow-java
- 1.0.0-SNAPSHOT
+ 1.2.0-SNAPSHOT
pom
TensorFlow Java Parent
@@ -26,11 +26,12 @@
https://github.com/tensorflow/java.git
- git@github.com:tensorflow/java.git
+ scm:git@github.com:tensorflow/java.git
scm:git:https://github.com/tensorflow/java.git
+ tensorflow-ndarray
tensorflow-core
tensorflow-framework
@@ -49,7 +50,7 @@
true
true
true
- 2.43.0
+ 2.46.1
@@ -87,8 +88,8 @@
-->
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
+ central
+ https://central.sonatype.com/repository/maven-snapshots
ossrh
@@ -212,7 +213,7 @@
-Xlint:all
-XDcompilePolicy=simple
- -Xplugin:ErrorProne
+
-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
@@ -329,6 +330,18 @@
+
+ linux-arm64
+
+
+ linux
+ aarch64
+
+
+ !javacpp.platform.extension
+
+
+
macosx
@@ -534,16 +547,38 @@
maven-javadoc-plugin
- 3.6.0
+ 3.12.0
+
+ ./docs/overview.md
+
+ Copyright 2015, 2025 The TensorFlow Authors. All Rights Reserved.
+
+ -Xmaxerrs
+ 65536
+ -Xmaxwarns
+ 65536
+
+ false
+ 256m
+ 2048m
+
+ https://tensorflow.github.io/java/javadoc-ndarray/v1.0.0/
+ https://protobuf.dev/reference/java/api-docs
+ https://bytedeco.org/javacpp/apidocs
+
+
+
+ javadoc-site
+
+ javadoc
+
+
attach-javadocs
jar
-
- true
-
diff --git a/release.sh b/release.sh
index 01f99386a71..acd1041d766 100755
--- a/release.sh
+++ b/release.sh
@@ -34,7 +34,7 @@ fi
# To get a shell to poke around the maven artifacts with.
if [[ -z "${CMD}" ]]
then
- CMD="mvn clean deploy -B -e --settings ./settings.xml -Pdeploying -Preleasing -DstagingRepositoryId=${STAGING_SEQ}"
+ CMD="mvn clean deploy -B -e --settings ./settings.xml -Pdeploying -Preleasing -DstagingRepositoryId=orgtensorflow-${STAGING_SEQ}"
fi
export GPG_TTY=$(tty)
diff --git a/tensorflow-core/pom.xml b/tensorflow-core/pom.xml
index d0ea8480f95..03c548a4111 100644
--- a/tensorflow-core/pom.xml
+++ b/tensorflow-core/pom.xml
@@ -22,7 +22,7 @@
org.tensorflow
tensorflow-java
- 1.0.0-SNAPSHOT
+ 1.2.0-SNAPSHOT
tensorflow-core
pom
@@ -42,7 +42,7 @@
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/workspace2.bzl
(but for the currently used release, not master)
-->
- 3.21.9
+ 4.28.3
${javacpp.platform}${javacpp.platform.extension}
@@ -59,7 +59,7 @@
macosx-arm64${javacpp.platform.extension}
macosx-x86_64${javacpp.platform.extension}
windows-x86_64${javacpp.platform.extension}
- 1.5.10
+ 1.5.12
diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml
index 1d43bd43454..a4cd84dcf20 100644
--- a/tensorflow-core/tensorflow-core-api/pom.xml
+++ b/tensorflow-core/tensorflow-core-api/pom.xml
@@ -6,7 +6,7 @@
org.tensorflow
tensorflow-core
- 1.0.0-SNAPSHOT
+ 1.2.0-SNAPSHOT
tensorflow-core-api
jar
@@ -15,7 +15,6 @@
Platform-dependent native code and pure-Java code for the TensorFlow machine intelligence library.
- 1.0.0-rc.1
1.1.5
false
${project.build.directory}/tf-text-download/
@@ -24,8 +23,8 @@
org.tensorflow
- ndarray
- ${ndarray.version}
+ tensorflow-ndarray
+ ${project.version}
org.tensorflow
@@ -220,24 +219,6 @@
-
- maven-javadoc-plugin
- 3.6.0
-
-
- attach-javadocs
-
- jar
-
-
- false
- 256m
- 2048m
-
-
-
-
-
org.codehaus.mojo
exec-maven-plugin
diff --git a/tensorflow-core/tensorflow-core-api/scripts/test_download.sh b/tensorflow-core/tensorflow-core-api/scripts/test_download.sh
index 03e4c854285..509468bade2 100755
--- a/tensorflow-core/tensorflow-core-api/scripts/test_download.sh
+++ b/tensorflow-core/tensorflow-core-api/scripts/test_download.sh
@@ -5,10 +5,13 @@ DOWNLOAD_FOLDER="$1"
case ${PLATFORM:-} in
'linux-x86_64')
- TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/c5/ef/5b8270e5665923bda4222f56382d9fbcb7fd6efd5fb8557ad0776848cdff/tensorflow_text-2.16.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'
+ TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/c3/e6/cfd784298ffb759a4235721cac2ac20f7ff758bf687069cfbaebb06c5804/tensorflow_text-2.20.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl'
;;
- 'macosx-x86_64')
- TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/ed/5d/b55f48cdf98a164d293f660748c2501ea828e148250a4cadbb5b0d988735/tensorflow_text-2.16.1-cp311-cp311-macosx_10_9_x86_64.whl'
+ 'linux-arm64')
+ TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/f5/ca/796cfd97ae6693d3c84c37575a6d481be5f1ef36c920d1a73c884f31797b/tensorflow_text-2.20.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl'
+ ;;
+ 'macosx-arm64')
+ TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/98/e4/e3c72d0a73caeba90cf5b31e69d44e9a08d614e0e829484d813f3b63e037/tensorflow_text-2.20.0-cp312-cp312-macosx_11_0_arm64.whl'
;;
*)
echo "TensorFlow Text distribution for ${PLATFORM} is not supported for download"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckPinned.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckPinned.pbtxt
new file mode 100644
index 00000000000..fff873c9bbf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckPinned.pbtxt
@@ -0,0 +1,6 @@
+op {
+ graph_op_name: "CheckPinned"
+ endpoint {
+ name: "CheckPinned"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSize.pbtxt
index 91551fab016..3bedfe49d78 100644
--- a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSize.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSize.pbtxt
@@ -1,6 +1,6 @@
op {
graph_op_name: "ComputeDedupDataSize"
- visibility: VISIBLE
+ visibility: SKIP
endpoint {
name: "tpu.ComputeDedupDataSize"
}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSizeV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSizeV2.pbtxt
new file mode 100644
index 00000000000..af5bdc31f13
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSizeV2.pbtxt
@@ -0,0 +1,6 @@
+op {
+ graph_op_name: "ComputeDedupDataSizeV2"
+ endpoint {
+ name: "tpu.ComputeDedupDataSize"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMask.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMask.pbtxt
index 946eab7e85a..cb0cd71c3f3 100644
--- a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMask.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMask.pbtxt
@@ -1,5 +1,5 @@
op {
- visibility: VISIBLE
+ visibility: SKIP
graph_op_name: "ComputeDedupDataTupleMask"
endpoint {
name: "tpu.ComputeDedupDataTupleMask"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMaskV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMaskV2.pbtxt
new file mode 100644
index 00000000000..75e34703b13
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMaskV2.pbtxt
@@ -0,0 +1,6 @@
+op {
+ graph_op_name: "ComputeDedupDataTupleMaskV2"
+ endpoint {
+ name: "tpu.ComputeDedupDataTupleMask"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToListOfSparseCoreCooTensors.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToListOfSparseCoreCooTensors.pbtxt
new file mode 100644
index 00000000000..99d2ebea438
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToListOfSparseCoreCooTensors.pbtxt
@@ -0,0 +1,7 @@
+op {
+ graph_op_name: "ConvertToListOfSparseCoreCooTensors"
+ visibility: VISIBLE
+ endpoint {
+ name: "sparse.ConvertToListOfSparseCoreCooTensors"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToSparseCoreCsrWrappedCooTensor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToSparseCoreCsrWrappedCooTensor.pbtxt
new file mode 100644
index 00000000000..6b78c0b216c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToSparseCoreCsrWrappedCooTensor.pbtxt
@@ -0,0 +1,7 @@
+op {
+ graph_op_name: "ConvertToSparseCoreCsrWrappedCooTensor"
+ visibility: VISIBLE
+ endpoint {
+ name: "sparse.ConvertToSparseCoreCsrWrappedCooTensor"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeWebP.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeWebP.pbtxt
new file mode 100644
index 00000000000..5bd8c3f5508
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeWebP.pbtxt
@@ -0,0 +1,6 @@
+op {
+ graph_op_name: "DecodeWebP"
+ endpoint {
+ name: "image.DecodeWebP"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbedding.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbedding.pbtxt
index bb76cd12973..5a5262fbe5a 100644
--- a/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbedding.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbedding.pbtxt
@@ -1,5 +1,5 @@
op {
- visibility: VISIBLE
+ visibility: SKIP
graph_op_name: "FinalizeTPUEmbedding"
endpoint {
name: "tpu.FinalizeTPUEmbedding"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbeddingV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbeddingV2.pbtxt
new file mode 100644
index 00000000000..7a8840309e4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbeddingV2.pbtxt
@@ -0,0 +1,6 @@
+op {
+ graph_op_name: "FinalizeTPUEmbeddingV2"
+ endpoint {
+ name: "tpu.FinalizeTPUEmbedding"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetStatsFromListOfSparseCoreCooTensors.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetStatsFromListOfSparseCoreCooTensors.pbtxt
new file mode 100644
index 00000000000..11a2b9eccba
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetStatsFromListOfSparseCoreCooTensors.pbtxt
@@ -0,0 +1,7 @@
+op {
+ graph_op_name: "GetStatsFromListOfSparseCoreCooTensors"
+ visibility: VISIBLE
+ endpoint {
+ name: "sparse.GetStatsFromListOfSparseCoreCooTensors"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetTpuTaskId.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetTpuTaskId.pbtxt
new file mode 100644
index 00000000000..1072689506c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetTpuTaskId.pbtxt
@@ -0,0 +1,7 @@
+op {
+ graph_op_name: "GetTpuTaskId"
+ visibility: VISIBLE
+ endpoint {
+ name: "tpu.GetTpuTaskId"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GlobalShuffleDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GlobalShuffleDataset.pbtxt
new file mode 100644
index 00000000000..ed286d3ae31
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GlobalShuffleDataset.pbtxt
@@ -0,0 +1,6 @@
+op {
+ graph_op_name: "GlobalShuffleDataset"
+ endpoint {
+ name: "data.GlobalShuffleDataset"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IndexFlatMapDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IndexFlatMapDataset.pbtxt
new file mode 100644
index 00000000000..682904a7504
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IndexFlatMapDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+ graph_op_name: "IndexFlatMapDataset"
+ visibility: VISIBLE
+ endpoint {
+ name: "data.IndexFlatMapDataset"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetModelProto.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetModelProto.pbtxt
new file mode 100644
index 00000000000..588803255e0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetModelProto.pbtxt
@@ -0,0 +1,6 @@
+op {
+ graph_op_name: "IteratorGetModelProto"
+ endpoint {
+ name: "data.IteratorGetModelProto"
+ }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSumV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSumV2.pbtxt
index 0895c391f2b..4478e3a5fb8 100644
--- a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSumV2.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSumV2.pbtxt
@@ -4,4 +4,18 @@ op {
endpoint {
name: "math.SegmentSum"
}
+ description: <
*
- * @param data type for {@code z} output
* @param x The x value
* @param y The y value
* @param data type for {@code BitwiseAnd} output and operands
@@ -91,7 +90,6 @@ public BitwiseAnd bitwiseAnd(Operand x, Operand y)
* tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE
*
*
- * @param data type for {@code z} output
* @param x The x value
* @param y The y value
* @param data type for {@code BitwiseOr} output and operands
@@ -121,7 +119,6 @@ public BitwiseOr bitwiseOr(Operand x, Operand y) {
* tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE
*
*
- * @param 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: *
@@ -69,7 +69,6 @@ public AsString asString(Operand extends TType> input, AsString.Options... opt /** * Cast x of type SrcT to y of DstT. * - * @param data type for {@code y} output * @param x The x value * @param DstT The value of the DstT attribute * @param options carries optional attribute values @@ -95,7 +94,6 @@ public Cast cast(Operand extends TType> x, Class DstT, * tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]] * * - * @param data type for {@code out} output * @param real The real value * @param imag The imag value * @param Tout The value of the Tout attribute 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 801e020d814..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; @@ -71,7 +72,7 @@ /** * An API for building {@code image} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class ImageOps { private final Scope scope; @@ -93,7 +94,6 @@ public final class ImageOps { * channel and then adjusts each component of each pixel to * {@code (x - mean) * contrast_factor + mean}. * - * @param* * - * @paramdata type for {@code output} output * @param images Images to adjust. At least 3-D. * @param contrastFactor A float multiplier for adjusting contrast. * @param data type for {@code AdjustContrastv2} output and operands @@ -112,7 +112,6 @@ public AdjustContrast adjustContrast(Operand images, * colors are first mapped into HSV. A delta is then applied all the hue values, * and then remapped back to RGB colorspace. * - * @param data type for {@code output} output * @param images Images to adjust. At least 3-D. * @param delta A float delta to add to the hue. * @param data type for {@code AdjustHue} output and operands @@ -130,7 +129,6 @@ public AdjustHue adjustHue(Operand images, Operand data type for {@code output} output * @param images Images to adjust. At least 3-D. * @param scale A float scale to add to the saturation. * @param data type for {@code AdjustSaturation} output and operands @@ -250,7 +248,6 @@ public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand grads, /** * Computes the gradient of the crop_and_resize op wrt the input image tensor. * - * @param data type for {@code output} output * @param grads A 4-D tensor of shape {@code [num_boxes, crop_height, crop_width, depth]}. * @param boxes A 2-D tensor of shape {@code [num_boxes, 4]}. The {@code i}-th row of the tensor * specifies the coordinates of a box in the {@code box_ind[i]} image and is specified @@ -340,51 +337,52 @@ public DecodeGif decodeGif(Operand contents) { } /** - * 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 * first frame that does not occupy the entire canvas, it uses the previous * frame to fill the unoccupied areas. * - * @param
data type for {@code image} output * @param contents 0-D. The encoded image bytes. * @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 * first frame that does not occupy the entire canvas, it uses the previous * frame to fill the unoccupied areas. * - * @param
data type for {@code image} output * @param contents 0-D. The encoded image bytes. * @param dtype The desired DType of the returned Tensor. * @param options carries optional attribute values @@ -438,12 +436,11 @@ public DecodeJpeg decodeJpeg(Operand contents, DecodeJpeg.Options... op * This op also supports decoding JPEGs and non-animated GIFs since the interface * is the same, though it is cleaner to use {@code tf.io.decode_image}. * - * @param
data type for {@code image} output * @param contents 0-D. The PNG-encoded image. * @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); } @@ -463,7 +460,6 @@ public DecodePng decodePng(Operand contents, DecodePng.Options[ * This op also supports decoding JPEGs and non-animated GIFs since the interface * is the same, though it is cleaner to use {@code tf.io.decode_image}. * - * @param
data type for {@code image} output * @param contents 0-D. The PNG-encoded image. * @param dtype The value of the dtype attribute * @param options carries optional attribute values @@ -475,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 @@ -487,7 +528,6 @@ public DecodePng decodePng(Operand contents, Cla * the bounding box will be {@code (40, 10)} to {@code (100, 50)} (in (x,y) coordinates). * Parts of the bounding box may fall outside the image. * - * @param
data type for {@code output} output * @param images 4-D with shape {@code [batch, height, width, depth]}. A batch of images. * @param boxes 3-D with shape {@code [batch, num_bounding_boxes, 4]} containing bounding * boxes. @@ -602,7 +642,6 @@ public ExtractGlimpse extractGlimpse(Operand input, Operand si /** * Extract {@code patches} from {@code images} and put them in the "depth" output dimension. * - * @param data type for {@code patches} output * @param images 4-D Tensor with shape {@code [batch, in_rows, in_cols, depth]}. * @param ksizes The size of the sliding window for each dimension of {@code images}. * @param strides How far the centers of two consecutive patches are in @@ -626,7 +665,6 @@ public ExtractImagePatches extractImagePatches(Operand i * Extract the shape information of a JPEG-encoded image. * This op only parses the image header, so it is much faster than DecodeJpeg. * - * @param data type for {@code image_shape} output * @param contents 0-D. The JPEG-encoded image. * @return a new instance of ExtractJpegShape, with default output types */ @@ -638,7 +676,6 @@ public ExtractJpegShape extractJpegShape(Operand contents) { * Extract the shape information of a JPEG-encoded image. * This op only parses the image header, so it is much faster than DecodeJpeg. * - * @param data type for {@code image_shape} output * @param contents 0-D. The JPEG-encoded image. * @param outputType (Optional) The output type of the operation (int32 or int64). * Defaults to int32. @@ -691,7 +728,6 @@ public GenerateBoundingBoxProposals generateBoundingBoxProposals(Operand See {@code rgb_to_hsv} for a description of the HSV encoding. * - * @param data type for {@code output} output * @param images 1-D or higher rank. HSV data to convert. Last dimension must be size 3. * @param data type for {@code HSVToRGB} output and operands * @return a new instance of HsvToRgb @@ -708,7 +744,6 @@ public HsvToRgb hsvToRgb(Operand images) { * {@code k = c0 x + c1 y + 1}. If the transformed point lays outside of the input * image, the output pixel is set to 0. * - * @param data type for {@code transformed_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param transforms 2-D Tensor, {@code [batch, 8]} or {@code [1, 8]} matrix, where each row corresponds to a 3 x 3 * projective transformation matrix, with the last entry assumed to be 1. If there @@ -733,7 +768,6 @@ public ImageProjectiveTransformV2 imageProjectiveTransfor * {@code k = c0 x + c1 y + 1}. If the transformed point lays outside of the input * image, the output pixel is set to fill_value. * - * @param data type for {@code transformed_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param transforms 2-D Tensor, {@code [batch, 8]} or {@code [1, 8]} matrix, where each row corresponds to a 3 x 3 * projective transformation matrix, with the last entry assumed to be 1. If there @@ -794,7 +828,6 @@ public NearestNeighbors nearestNeighbors(Operand points, Operand data type for {@code selected_scores} output * @param boxes A 2-D float tensor of shape {@code [num_boxes, 4]}. * @param scores A 1-D float tensor of shape {@code [num_boxes]} representing a single * score corresponding to each box (each row of boxes). @@ -854,7 +887,6 @@ public NonMaxSuppressionWithOverlaps nonMaxSuppressionWithOverlaps(Operand data type for {@code resized_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The * new size for the images. @@ -878,7 +910,6 @@ public QuantizedResizeBilinear quantizedResizeBilinear(Op * rectangle from that location. The random location is picked so the cropped * area will fit inside the original image. * - * @param data type for {@code output} output * @param image 3-D of shape {@code [height, width, channels]}. * @param sizeOutput 1-D of length 2 containing: {@code crop_height}, {@code crop_width}.. * @param options carries optional attribute values @@ -931,7 +962,6 @@ public ResizeBicubic resizeBicubic(Operand extends TNumber> images, Operand data type for {@code output} output * @param grads 4-D with shape {@code [batch, height, width, channels]}. * @param originalImage 4-D with shape {@code [batch, orig_height, orig_width, channels]}, * The image tensor that was resized. @@ -962,7 +992,6 @@ public ResizeBilinear resizeBilinear(Operand extends TNumber> images, /** * Computes the gradient of bilinear interpolation. * - * @param data type for {@code output} output * @param grads 4-D with shape {@code [batch, height, width, channels]}. * @param originalImage 4-D with shape {@code [batch, orig_height, orig_width, channels]}, * The image tensor that was resized. @@ -978,7 +1007,6 @@ public ResizeBilinearGrad resizeBilinearGrad(Operand data type for {@code resized_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The * new size for the images. @@ -994,7 +1022,6 @@ public ResizeNearestNeighbor resizeNearestNeighbor(Operan /** * Computes the gradient of nearest neighbor interpolation. * - * @param data type for {@code output} output * @param grads 4-D with shape {@code [batch, height, width, channels]}. * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code orig_height, orig_width}. The * original input size. @@ -1031,7 +1058,6 @@ public ResizeNearestNeighborGrad resizeNearestNeighborGra *
The minibatch size {@code N} is extracted from {@code sparse_shape[0]}.
*
- * @param data type for {@code serialized_sparse} output
* @param sparseIndices 2-D. The {@code indices} of the minibatch {@code SparseTensor}.
* @param sparseValues 1-D. The {@code values} of the minibatch {@code SparseTensor}.
* @param sparseShape 1-D. The {@code shape} of the minibatch {@code SparseTensor}.
@@ -903,7 +898,6 @@ public SerializeManySparse The minibatch size {@code N} is extracted from {@code sparse_shape[0]}.
*
- * @param data type for {@code serialized_sparse} output
* @param sparseIndices 2-D. The {@code indices} of the minibatch {@code SparseTensor}.
* @param sparseValues 1-D. The {@code values} of the minibatch {@code SparseTensor}.
* @param sparseShape 1-D. The {@code shape} of the minibatch {@code SparseTensor}.
@@ -920,7 +914,6 @@ public SerializeManySparse serializeManySparse(Operand Computes the inverse of one or more square invertible matrices or their
+ * adjoints (conjugate transposes).
*
- * @param Note: The default kernel implementation for MatMul on GPUs uses
* cublas.
*
- * @param
{@literal @}end_compatibility
*
*
- * @param