You've already forked macports-ports
mirror of
https://github.com/encounter/macports-ports.git
synced 2026-03-30 11:29:27 -07:00
68d57fc88f
See: https://trac.macports.org/ticket/60960#comment:2 Use LTS JDK as fallback Public updates for openjdk12 ended 2019-09 Public updates for openjdk14 will end 2020-09 Public updates for openjdk11 will continue at least until 2023 Use legacysupport portgroup for clock_gettime() Remove unused portgroup xcodeversion Don't set use_mp_clang before using xcode_workaround
46 lines
1.8 KiB
Diff
46 lines
1.8 KiB
Diff
From 75ea0b31477d6ba9e990e296bbbd8ca4e7eebadf Mon Sep 17 00:00:00 2001
|
|
From: Christian Sigg <csigg@google.com>
|
|
Date: Fri, 26 Jun 2020 05:08:10 -0700
|
|
Subject: [PATCH] Provide overload to cope with const-ness change of NumPy's
|
|
PyUFuncGenericFunction.
|
|
|
|
See https://github.com/tensorflow/tensorflow/issues/40688, https://github.com/tensorflow/tensorflow/pull/40654.
|
|
|
|
PiperOrigin-RevId: 318452381
|
|
Change-Id: Icc5152f2b020ef19882a49e3c86ac80bbe048d64
|
|
---
|
|
tensorflow/python/lib/core/bfloat16.cc | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/tensorflow/python/lib/core/bfloat16.cc b/tensorflow/python/lib/core/bfloat16.cc
|
|
index feb01f11a1af2..bb6b720febe59 100644
|
|
--- a/tensorflow/python/lib/core/bfloat16.cc
|
|
+++ b/tensorflow/python/lib/core/bfloat16.cc
|
|
@@ -517,7 +517,7 @@ bool RegisterBfloat16Cast(int numpy_type, bool cast_is_safe) {
|
|
}
|
|
|
|
template <typename InType, typename OutType, typename Functor>
|
|
-void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
|
|
+void BinaryUFunc(char** args, const npy_intp* dimensions, const npy_intp* steps,
|
|
void* data) {
|
|
const char* i0 = args[0];
|
|
const char* i1 = args[1];
|
|
@@ -532,11 +532,17 @@ void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
|
|
}
|
|
}
|
|
|
|
+// Numpy changed const-ness of PyUFuncGenericFunction, provide overload.
|
|
template <typename Functor>
|
|
void CompareUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
|
|
void* data) {
|
|
BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
|
|
}
|
|
+template <typename Functor>
|
|
+void CompareUFunc(char** args, const npy_intp* dimensions,
|
|
+ const npy_intp* steps, void* data) {
|
|
+ BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
|
|
+}
|
|
|
|
struct Bfloat16EqFunctor {
|
|
npy_bool operator()(bfloat16 a, bfloat16 b) { return a == b; }
|