Skip to content

Commit 6f656f8

Browse files
committed
Upgrade for TensorFlow 2.6.0
1 parent 242931c commit 6f656f8

File tree

1,375 files changed

+9277
-5296
lines changed

Some content is hidden

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

1,375 files changed

+9277
-5296
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</modules>
3737

3838
<properties>
39-
<project.build.sourceEncoding>ASCII</project.build.sourceEncoding>
39+
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
4040
<maven.compiler.source>1.8</maven.compiler.source>
4141
<maven.compiler.target>1.8</maven.compiler.target>
4242
<junit.version>5.6.2</junit.version>

tensorflow-core/tensorflow-core-api/WORKSPACE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ http_archive(
99
name = "org_tensorflow",
1010
patches = [
1111
":tensorflow-visibility.patch",
12-
":tensorflow-macosx.patch",
12+
# ":tensorflow-macosx.patch",
1313
# ":tensorflow-windows.patch", # https://github.com/tensorflow/tensorflow/issues/25213
1414
":tensorflow-proto.patch",
1515
],
1616
patch_tool = "patch",
1717
patch_args = ["-p1"],
1818
patch_cmds = ["grep -rl 'java_package' tensorflow/core | xargs sed -i.bak 's/^\(.* java_package = \"org\.tensorflow\.\)\(.*\"\)/\\1proto.\\2'/"],
1919
urls = [
20-
"https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.5.0.tar.gz",
20+
"https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.6.0.tar.gz",
2121
],
22-
sha256 = "233875ea27fc357f6b714b2a0de5f6ff124b50c1ee9b3b41f9e726e9e677b86c",
23-
strip_prefix = "tensorflow-2.5.0"
22+
sha256 = "41b32eeaddcbc02b0583660bcf508469550e4cd0f86b22d2abe72dfebeacde0f",
23+
strip_prefix = "tensorflow-2.6.0"
2424
)
2525

2626
# START: Upstream TensorFlow dependencies

tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch

Lines changed: 70 additions & 73 deletions
Large diffs are not rendered by default.

tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
diff -ruN tensorflow-2.5.0-rc1/tensorflow/BUILD tensorflow-2.5.0-rc1-visibility/tensorflow/BUILD
2-
--- tensorflow-2.5.0-rc1/tensorflow/BUILD 2021-04-13 01:43:40.000000000 +0900
3-
+++ tensorflow-2.5.0-rc1-visibility/tensorflow/BUILD 2021-04-27 10:26:14.196211286 +0900
4-
@@ -38,7 +38,7 @@
1+
diff -ruN tensorflow-2.6.0/tensorflow/BUILD tensorflow-2.6.0-visibility/tensorflow/BUILD
2+
--- tensorflow-2.6.0/tensorflow/BUILD 2021-08-10 04:10:27.000000000 +0900
3+
+++ tensorflow-2.6.0-visibility/tensorflow/BUILD 2021-08-30 11:18:31.089781754 +0900
4+
@@ -37,7 +37,7 @@
5+
)
56
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
67

7-
package(
8-
- default_visibility = [":internal"],
9-
+ default_visibility = ["//visibility:public"],
10-
licenses = ["notice"], # Apache 2.0
11-
)
8+
-package(default_visibility = [":internal"])
9+
+package(default_visibility = ["//visibility:public"])
10+
11+
licenses(["notice"])
1212

13-
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/api_def/BUILD tensorflow-2.5.0-rc1-visibility/tensorflow/core/api_def/BUILD
14-
--- tensorflow-2.5.0-rc1/tensorflow/core/api_def/BUILD 2021-04-13 01:43:40.000000000 +0900
15-
+++ tensorflow-2.5.0-rc1-visibility/tensorflow/core/api_def/BUILD 2021-04-27 10:29:38.712785268 +0900
13+
diff -ruN tensorflow-2.6.0/tensorflow/core/api_def/BUILD tensorflow-2.6.0-visibility/tensorflow/core/api_def/BUILD
14+
--- tensorflow-2.6.0/tensorflow/core/api_def/BUILD 2021-08-10 04:10:27.000000000 +0900
15+
+++ tensorflow-2.6.0-visibility/tensorflow/core/api_def/BUILD 2021-08-30 11:17:56.392705484 +0900
1616
@@ -29,7 +29,7 @@
1717
alias(
1818
name = "base_api_def",
@@ -22,9 +22,9 @@ diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/api_def/BUILD tensorflow-2.5.0-rc
2222
)
2323

2424
alias(
25-
diff -ruN tensorflow-2.5.0-rc1/tensorflow/tools/api/lib/BUILD tensorflow-2.5.0-rc1-visibility/tensorflow/tools/api/lib/BUILD
26-
--- tensorflow-2.5.0-rc1/tensorflow/tools/api/lib/BUILD 2021-04-13 01:43:40.000000000 +0900
27-
+++ tensorflow-2.5.0-rc1-visibility/tensorflow/tools/api/lib/BUILD 2021-04-27 10:26:14.196211286 +0900
25+
diff -ruN tensorflow-2.6.0/tensorflow/tools/api/lib/BUILD tensorflow-2.6.0-visibility/tensorflow/tools/api/lib/BUILD
26+
--- tensorflow-2.6.0/tensorflow/tools/api/lib/BUILD 2021-08-10 04:10:27.000000000 +0900
27+
+++ tensorflow-2.6.0-visibility/tensorflow/tools/api/lib/BUILD 2021-08-30 11:17:56.392705484 +0900
2828
@@ -16,6 +16,7 @@
2929
tf_proto_library(
3030
name = "api_objects_proto",

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,15 @@ public DeserializeIterator deserializeIterator(Operand<? extends TType> resource
475475
* the values of {@code selector_input_dataset}.
476476
* @param outputTypes the value of the outputTypes property
477477
* @param outputShapes the value of the outputShapes property
478+
* @param options carries optional attribute values
478479
* @return a new instance of DirectedInterleaveDataset
479480
*/
480481
public DirectedInterleaveDataset directedInterleaveDataset(
481482
Operand<? extends TType> selectorInputDataset,
482483
Iterable<Operand<? extends TType>> dataInputDatasets,
483-
List<Class<? extends TType>> outputTypes, List<Shape> outputShapes) {
484-
return DirectedInterleaveDataset.create(scope, selectorInputDataset, dataInputDatasets, outputTypes, outputShapes);
484+
List<Class<? extends TType>> outputTypes, List<Shape> outputShapes,
485+
DirectedInterleaveDataset.Options... options) {
486+
return DirectedInterleaveDataset.create(scope, selectorInputDataset, dataInputDatasets, outputTypes, outputShapes, options);
485487
}
486488

487489
/**

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

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.tensorflow.op.math.Betainc;
3838
import org.tensorflow.op.math.Bincount;
3939
import org.tensorflow.op.math.Ceil;
40-
import org.tensorflow.op.math.CompareAndBitpack;
4140
import org.tensorflow.op.math.ComplexAbs;
4241
import org.tensorflow.op.math.Conj;
4342
import org.tensorflow.op.math.Cos;
@@ -481,11 +480,22 @@ public <T extends TType> Atan<T> atan(Operand<T> x) {
481480

482481
/**
483482
* Computes arctangent of {@code y/x} element-wise, respecting signs of the arguments.
484-
* This is the angle ( \theta \in [-\pi, \pi] ) such that
485-
* [ x = r \cos(\theta) ]
483+
* This is the angle \( \theta \in [-\pi, \pi] \) such that
484+
* \[ x = r \cos(\theta) \]
486485
* and
487-
* [ y = r \sin(\theta) ]
488-
* where (r = \sqrt(x^2 + y^2) ).
486+
* \[ y = r \sin(\theta) \]
487+
* where \(r = \sqrt{x^2 + y^2} \).
488+
* <p>For example:
489+
* <blockquote>
490+
* <blockquote>
491+
* <blockquote>
492+
* <p>x = [1., 1.]
493+
* y = [1., -1.]
494+
* print((tf.math.atan2(y,x) * (180 / np.pi)).numpy())
495+
* [ 45. -45.]
496+
* </blockquote>
497+
* </blockquote>
498+
* </blockquote>
489499
*
490500
* @param <T> data type for {@code z} output
491501
* @param y the y value
@@ -573,44 +583,22 @@ public <T extends TNumber> Ceil<T> ceil(Operand<T> x) {
573583
return Ceil.create(scope, x);
574584
}
575585

576-
/**
577-
* Compare values of {@code input} to {@code threshold} and pack resulting bits into a {@code uint8}.
578-
* Each comparison returns a boolean {@code true} (if {@code input_value > threshold})
579-
* or and {@code false} otherwise.
580-
* <p>This operation is useful for Locality-Sensitive-Hashing (LSH) and other
581-
* algorithms that use hashing approximations of cosine and {@code L2} distances;
582-
* codes can be generated from an input via:
583-
* <pre>
584-
* codebook_size = 50
585-
* codebook_bits = codebook_size * 32
586-
* codebook = tf.get_variable('codebook', [x.shape[-1].value, codebook_bits],
587-
* dtype=x.dtype,
588-
* initializer=tf.orthogonal_initializer())
589-
* codes = compare_and_threshold(tf.matmul(x, codebook), threshold=0.)
590-
* codes = tf.bitcast(codes, tf.int32) # go from uint8 to int32
591-
* # now codes has shape x.shape[:-1] + [codebook_size]
592-
* </pre>
593-
* <p><strong>NOTE</strong>: Currently, the innermost dimension of the tensor must be divisible
594-
* by 8.
595-
* <p>Given an {@code input} shaped {@code [s0, s1, ..., s_n]}, the output is
596-
* a {@code uint8} tensor shaped {@code [s0, s1, ..., s_n / 8]}.
597-
*
598-
* @param input Values to compare against {@code threshold} and bitpack.
599-
* @param threshold Threshold to compare against.
600-
* @param <T> data type for {@code CompareAndBitpack} output and operands
601-
* @return a new instance of CompareAndBitpack
602-
*/
603-
public <T extends TType> CompareAndBitpack compareAndBitpack(Operand<T> input,
604-
Operand<T> threshold) {
605-
return CompareAndBitpack.create(scope, input, threshold);
606-
}
607-
608586
/**
609587
* Computes the complex absolute value of a tensor.
610588
* Given a tensor {@code x} of complex numbers, this operation returns a tensor of type
611589
* {@code float} or {@code double} that is the absolute value of each element in {@code x}. All
612590
* elements in {@code x} must be complex numbers of the form \(a + bj\). The absolute
613591
* value is computed as \( \sqrt{a^2 + b^2}\).
592+
* <p>For example:
593+
* <blockquote>
594+
* <blockquote>
595+
* <blockquote>
596+
* <p>x = tf.complex(3.0, 4.0)
597+
* print((tf.raw_ops.ComplexAbs(x=x, Tout=tf.dtypes.float32, name=None)).numpy())
598+
* 5.0
599+
* </blockquote>
600+
* </blockquote>
601+
* </blockquote>
614602
*
615603
* @param <U> data type for {@code y} output
616604
* @param x the x value
@@ -626,6 +614,16 @@ public ComplexAbs<TFloat32> complexAbs(Operand<? extends TType> x) {
626614
* {@code float} or {@code double} that is the absolute value of each element in {@code x}. All
627615
* elements in {@code x} must be complex numbers of the form \(a + bj\). The absolute
628616
* value is computed as \( \sqrt{a^2 + b^2}\).
617+
* <p>For example:
618+
* <blockquote>
619+
* <blockquote>
620+
* <blockquote>
621+
* <p>x = tf.complex(3.0, 4.0)
622+
* print((tf.raw_ops.ComplexAbs(x=x, Tout=tf.dtypes.float32, name=None)).numpy())
623+
* 5.0
624+
* </blockquote>
625+
* </blockquote>
626+
* </blockquote>
629627
*
630628
* @param <U> data type for {@code y} output
631629
* @param x the x value
@@ -867,7 +865,7 @@ public <T extends TType> Equal equal(Operand<T> x, Operand<T> y, Equal.Options..
867865
}
868866

869867
/**
870-
* Computes the Gauss error function of {@code x} element-wise.
868+
* Computes the <a href="https://en.wikipedia.org/wiki/Error_function">Gauss error function</a> of {@code x} element-wise. In statistics, for non-negative values of $x$, the error function has the following interpretation: for a random variable $Y$ that is normally distributed with mean 0 and variance $1/\sqrt{2}$, $erf(x)$ is the probability that $Y$ falls in the range $[−x, x]$.
871869
*
872870
* @param <T> data type for {@code y} output
873871
* @param x the x value
@@ -1085,8 +1083,8 @@ public <T extends TNumber> Igamma<T> igamma(Operand<T> a, Operand<T> x) {
10851083
* The upper regularized incomplete Gamma function is defined as:
10861084
* <p>\(Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\)
10871085
* <p>where
1088-
* <p>\(Gamma(a, x) = int_{x}^{\infty} t^{a-1} exp(-t) dt\)
1089-
* <p>is the upper incomplete Gama function.
1086+
* <p>\(Gamma(a, x) = \int_{x}^{\infty} t^{a-1} exp(-t) dt\)
1087+
* <p>is the upper incomplete Gamma function.
10901088
* <p>Note, above {@code P(a, x)} ({@code Igamma}) is the lower regularized complete
10911089
* Gamma function.
10921090
*
@@ -2234,9 +2232,9 @@ public <T extends TType> UnsortedSegmentProd<T> unsortedSegmentProd(Operand<T> d
22342232
* </div>
22352233
* <pre>
22362234
* c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
2237-
* tf.unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
2238-
* # ==&gt; [[ 5, 5, 5, 5],
2239-
* # [5, 6, 7, 8]]
2235+
* tf.math.unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
2236+
* # ==&gt; [[ 5, 5, 5, 5],
2237+
* # [5, 6, 7, 8]]
22402238
* </pre>
22412239
*
22422240
* @param <T> data type for {@code output} output

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,19 +1864,6 @@ public <T extends TNumber> Softsign<T> softsign(Operand<T> features) {
18641864
* the {@code height} and {@code width} dimensions are moved to the {@code batch} dimension. After
18651865
* the zero-padding, both {@code height} and {@code width} of the input must be divisible by the
18661866
* block size.
1867-
*
1868-
* @param <T> data type for {@code output} output
1869-
* @param input 4-D with shape {@code [batch, height, width, depth]}.
1870-
* @param paddings 2-D tensor of non-negative integers with shape {@code [2, 2]}. It specifies
1871-
* the padding of the input with zeros across the spatial dimensions as follows:
1872-
* <pre>
1873-
* paddings = [[pad_top, pad_bottom], [pad_left, pad_right]]
1874-
* </pre>
1875-
* <p>The effective spatial dimensions of the zero-padded input tensor will be:
1876-
* <pre>
1877-
* height_pad = pad_top + height + pad_bottom
1878-
* width_pad = pad_left + width + pad_right
1879-
* </pre>
18801867
* <p>The attr {@code block_size} must be greater than one. It indicates the block size.
18811868
* <ul>
18821869
* <li>Non-overlapping blocks of size {@code block_size x block size} in the height and
@@ -1935,6 +1922,19 @@ public <T extends TNumber> Softsign<T> softsign(Operand<T> features) {
19351922
* </pre>
19361923
* <p>Among others, this operation is useful for reducing atrous convolution into
19371924
* regular convolution.
1925+
*
1926+
* @param <T> data type for {@code output} output
1927+
* @param input 4-D with shape {@code [batch, height, width, depth]}.
1928+
* @param paddings 2-D tensor of non-negative integers with shape {@code [2, 2]}. It specifies
1929+
* the padding of the input with zeros across the spatial dimensions as follows:
1930+
* <pre>
1931+
* paddings = [[pad_top, pad_bottom], [pad_left, pad_right]]
1932+
* </pre>
1933+
* <p>The effective spatial dimensions of the zero-padded input tensor will be:
1934+
* <pre>
1935+
* height_pad = pad_top + height + pad_bottom
1936+
* width_pad = pad_left + width + pad_right
1937+
* </pre>
19381938
* @param blockSize the value of the blockSize property
19391939
* @param <T> data type for {@code SpaceToBatch} output and operands
19401940
* @return a new instance of SpaceToBatch

0 commit comments

Comments
 (0)