<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/68d57fc88f02d86ccc7478d738f27c70974868ab">https://github.com/macports/macports-ports/commit/68d57fc88f02d86ccc7478d738f27c70974868ab</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 68d57fc88f0 py-(tensorflow|tensorflow1): fix for NumPy 1.19.x
</span>68d57fc88f0 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 68d57fc88f02d86ccc7478d738f27c70974868ab
</span>Author: Christopher Chavez <chrischavez@gmx.us>
AuthorDate: Sat Oct 3 23:15:05 2020 -0500
<span style='display:block; white-space:pre;color:#404040;'> py-(tensorflow|tensorflow1): fix for NumPy 1.19.x
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> See: https://trac.macports.org/ticket/60960#comment:2
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Use LTS JDK as fallback
</span><span style='display:block; white-space:pre;color:#404040;'> Public updates for openjdk12 ended 2019-09
</span><span style='display:block; white-space:pre;color:#404040;'> Public updates for openjdk14 will end 2020-09
</span><span style='display:block; white-space:pre;color:#404040;'> Public updates for openjdk11 will continue at least until 2023
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Use legacysupport portgroup for clock_gettime()
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Remove unused portgroup xcodeversion
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Don't set use_mp_clang before using xcode_workaround
</span>---
python/py-tensorflow/Portfile | 18 +++++----
.../py-tensorflow/files/patch-numpy-1.19-fix.diff | 45 ++++++++++++++++++++++
python/py-tensorflow1/Portfile | 32 ++++++++++-----
.../files/CLOCK_REALTIME-Older-OSX.patch | 30 ---------------
.../py-tensorflow1/files/patch-numpy-1.19-fix.diff | 45 ++++++++++++++++++++++
5 files changed, 123 insertions(+), 47 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-tensorflow/Portfile b/python/py-tensorflow/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 79981153ac5..51cf078110b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-tensorflow/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-tensorflow/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,7 +5,6 @@ PortGroup python 1.0
</span> PortGroup java 1.0
PortGroup github 1.0
PortGroup compilers 1.0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-PortGroup xcodeversion 1.0
</span> PortGroup compiler_blacklist_versions 1.0
PortGroup xcode_workaround 1.0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -42,28 +41,33 @@ if { ${os.major} < ${min_darwin} } {
</span>
# Required java version
java.version 11+
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# JDK port to install if required java not found
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-java.fallback openjdk14
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# LTS JDK port to install if required java not found
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+java.fallback openjdk11
</span> # JDK only needed at build time, but java PG sets lib dependency so
# declare no conflict to allow redistribution of binaries.
license_noconflict ${java.fallback}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# require c++14
</span> compiler.cxx_standard 2014
# The oldest Xcode version to use default Xcode compiler
# https://github.com/tensorflow/tensorflow/issues/39262
set tf_min_xcode 10.2
compiler.blacklist-append {clang < 1001}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Work out if we should be using macports clang
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-set use_mp_clang [ expr ( [ string match macports-clang-* ${configure.compiler} ] || [ vercmp ${xcodeversion} ${tf_min_xcode} ] < 0 ) ]
</span>
# https://trac.macports.org/ticket/59192
xcode_workaround.type avoid_xcode_compiler
xcode_workaround.os_versions 18 19
xcode_workaround.fixed_xcode_version 11.4
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#patch.pre_args -p1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Work out if we should be using macports clang
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set use_mp_clang [ expr ( [ string match macports-clang-* ${configure.compiler} ] || [ vercmp ${xcodeversion} ${tf_min_xcode} ] < 0 ) ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patch.pre_args -p1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Remove when updating to 2.4.x
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/tensorflow/tensorflow/pull/40654
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/tensorflow/tensorflow/issues/40688
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-numpy-1.19-fix.diff
</span>
variant mkl description {Enable Intel Math Kernel Library support} {
# Not obvious if this dep is needed ?
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-tensorflow/files/patch-numpy-1.19-fix.diff b/python/py-tensorflow/files/patch-numpy-1.19-fix.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..5198d2d7997
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-tensorflow/files/patch-numpy-1.19-fix.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,45 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 75ea0b31477d6ba9e990e296bbbd8ca4e7eebadf Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Christian Sigg <csigg@google.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Fri, 26 Jun 2020 05:08:10 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] Provide overload to cope with const-ness change of NumPy's
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PyUFuncGenericFunction.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+See https://github.com/tensorflow/tensorflow/issues/40688, https://github.com/tensorflow/tensorflow/pull/40654.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PiperOrigin-RevId: 318452381
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Change-Id: Icc5152f2b020ef19882a49e3c86ac80bbe048d64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tensorflow/python/lib/core/bfloat16.cc | 8 +++++++-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 7 insertions(+), 1 deletion(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tensorflow/python/lib/core/bfloat16.cc b/tensorflow/python/lib/core/bfloat16.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index feb01f11a1af2..bb6b720febe59 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/tensorflow/python/lib/core/bfloat16.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tensorflow/python/lib/core/bfloat16.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -517,7 +517,7 @@ bool RegisterBfloat16Cast(int numpy_type, bool cast_is_safe) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ template <typename InType, typename OutType, typename Functor>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void BinaryUFunc(char** args, const npy_intp* dimensions, const npy_intp* steps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void* data) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char* i0 = args[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char* i1 = args[1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -532,11 +532,17 @@ void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// Numpy changed const-ness of PyUFuncGenericFunction, provide overload.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ template <typename Functor>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void CompareUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void* data) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++template <typename Functor>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void CompareUFunc(char** args, const npy_intp* dimensions,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const npy_intp* steps, void* data) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct Bfloat16EqFunctor {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ npy_bool operator()(bfloat16 a, bfloat16 b) { return a == b; }
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-tensorflow1/Portfile b/python/py-tensorflow1/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index f0bceee196a..562aa6e511b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-tensorflow1/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-tensorflow1/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,13 +5,14 @@ PortGroup python 1.0
</span> PortGroup java 1.0
PortGroup github 1.0
PortGroup compilers 1.0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-PortGroup xcodeversion 1.0
</span> PortGroup compiler_blacklist_versions 1.0
PortGroup xcode_workaround 1.0
<span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup legacysupport 1.0
</span>
name py-tensorflow1
version 1.15.4
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# If updating, uncomment revision here and delete separate revisions below
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#revision 0
</span> github.setup tensorflow tensorflow ${version} v
platforms darwin
supported_archs x86_64
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -41,28 +42,39 @@ if { ${os.major} < ${min_darwin} } {
</span> }
compiler.blacklist-append {clang < 840}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# require c++14
</span> compiler.cxx_standard 2014
patch.pre_args -p1
# Required java version
java.version 11+
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# JDK port to install if required java not found
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-java.fallback openjdk12
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# LTS JDK port to install if required java not found
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+java.fallback openjdk11
</span> # JDK only needed at build time, but java PG sets lib dependency so
# declare no conflict to allow redistribution of binaries.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-license_noconflict openjdk12
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+license_noconflict ${java.fallback}
</span>
# The oldest Xcode version to use default Xcode compiler
# Note setting here should be in sync with that in bazel
set tf_min_xcode 9.0
patchfiles-append Fix-build-failures-for-python-3.8.patch
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {${os.major} < 16} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Work around for issues with clock_gettime(CLOCK_REALTIME, &ts);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # https://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- patchfiles-append CLOCK_REALTIME-Older-OSX.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Need clock_gettime()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+legacysupport.newest_darwin_requires_legacy 15
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Patch needed only for Python 3.x (py27-numpy is pinned at 1.16.x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/tensorflow/tensorflow/pull/40654
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/tensorflow/tensorflow/issues/40688
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${python.version} != 27} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append patch-numpy-1.19-fix.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Delete if updating from 1.15.4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${os.major} < 16 && ${python.version} == 27} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ revision 0
</span> }
variant mkl description {Enable Intel Math Kernel Library support} { }
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-tensorflow1/files/CLOCK_REALTIME-Older-OSX.patch b/python/py-tensorflow1/files/CLOCK_REALTIME-Older-OSX.patch
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index b897dfc16fd..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-tensorflow1/files/CLOCK_REALTIME-Older-OSX.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,30 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git a/tensorflow/core/platform/posix/env_time.cc b/tensorflow/core/platform/posix/env_time.cc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 59a67b17aa..568f7158e0 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- a/tensorflow/core/platform/posix/env_time.cc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ b/tensorflow/core/platform/posix/env_time.cc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -18,6 +18,9 @@ limitations under the License.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "tensorflow/core/platform/env_time.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <mach/clock.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <mach/mach.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- namespace tensorflow {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- namespace {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -28,7 +31,14 @@ class PosixEnvTime : public EnvTime {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint64 NowNanos() override {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- struct timespec ts;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- clock_gettime(CLOCK_REALTIME, &ts);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ //clock_gettime(CLOCK_REALTIME, &ts);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ clock_serv_t cclock;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ mach_timespec_t mts;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ clock_get_time(cclock, &mts);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ mach_port_deallocate(mach_task_self(), cclock);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ts.tv_sec = mts.tv_sec;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ts.tv_nsec = mts.tv_nsec;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return (static_cast<uint64>(ts.tv_sec) * kSecondsToNanos +
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static_cast<uint64>(ts.tv_nsec));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-tensorflow1/files/patch-numpy-1.19-fix.diff b/python/py-tensorflow1/files/patch-numpy-1.19-fix.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..5198d2d7997
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-tensorflow1/files/patch-numpy-1.19-fix.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,45 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 75ea0b31477d6ba9e990e296bbbd8ca4e7eebadf Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Christian Sigg <csigg@google.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Fri, 26 Jun 2020 05:08:10 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] Provide overload to cope with const-ness change of NumPy's
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PyUFuncGenericFunction.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+See https://github.com/tensorflow/tensorflow/issues/40688, https://github.com/tensorflow/tensorflow/pull/40654.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PiperOrigin-RevId: 318452381
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Change-Id: Icc5152f2b020ef19882a49e3c86ac80bbe048d64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tensorflow/python/lib/core/bfloat16.cc | 8 +++++++-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 7 insertions(+), 1 deletion(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tensorflow/python/lib/core/bfloat16.cc b/tensorflow/python/lib/core/bfloat16.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index feb01f11a1af2..bb6b720febe59 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/tensorflow/python/lib/core/bfloat16.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tensorflow/python/lib/core/bfloat16.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -517,7 +517,7 @@ bool RegisterBfloat16Cast(int numpy_type, bool cast_is_safe) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ template <typename InType, typename OutType, typename Functor>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void BinaryUFunc(char** args, const npy_intp* dimensions, const npy_intp* steps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void* data) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char* i0 = args[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char* i1 = args[1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -532,11 +532,17 @@ void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// Numpy changed const-ness of PyUFuncGenericFunction, provide overload.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ template <typename Functor>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void CompareUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void* data) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++template <typename Functor>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void CompareUFunc(char** args, const npy_intp* dimensions,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const npy_intp* steps, void* data) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct Bfloat16EqFunctor {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ npy_bool operator()(bfloat16 a, bfloat16 b) { return a == b; }
</span></pre><pre style='margin:0'>
</pre>