diff --git a/science/py-tensorflow/files/patch-tensorflow_lite_kernels_elementwise.cc b/science/py-tensorflow/files/patch-tensorflow_lite_kernels_elementwise.cc new file mode 100644 index 000000000000..7fad158af10a --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_lite_kernels_elementwise.cc @@ -0,0 +1,22 @@ +--- tensorflow/lite/kernels/elementwise.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/lite/kernels/elementwise.cc +@@ -242,7 +242,8 @@ TfLiteStatus AbsEval(TfLiteContext* context, TfLiteNod + const TfLiteType type = input->type; + switch (type) { + case kTfLiteFloat32: +- return EvalImpl(context, node, std::abs, type); ++ return EvalImpl( ++ context, node, [](float f) { return std::abs(f); }, type); + case kTfLiteInt8: + return AbsEvalQuantized(context, node, type); + case kTfLiteInt16: +@@ -250,7 +251,8 @@ TfLiteStatus AbsEval(TfLiteContext* context, TfLiteNod + ? AbsInt16EvalImpl(context, node, type) + : AbsEvalQuantized(context, node, type); + case kTfLiteInt32: +- return EvalImpl(context, node, std::abs, type); ++ return EvalImpl( ++ context, node, [](int32_t i) { return std::abs(i); }, type); + default: + TF_LITE_KERNEL_LOG(context, "Current data type %s is not supported.", + TfLiteTypeGetName(type)); diff --git a/science/py-tensorflow/files/patch-tensorflow_tsl_framework_type__traits.h b/science/py-tensorflow/files/patch-tensorflow_tsl_framework_type__traits.h new file mode 100644 index 000000000000..8b2cfe43ee49 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tsl_framework_type__traits.h @@ -0,0 +1,21 @@ +--- tensorflow/tsl/framework/type_traits.h.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/tsl/framework/type_traits.h +@@ -91,18 +91,6 @@ class numeric_limits : public numeric_lim + template <> + class numeric_limits : public numeric_limits {}; + +-// Specialize is_signed for quantized types. +-template <> +-struct is_signed : public is_signed {}; +-template <> +-struct is_signed : public is_signed {}; +-template <> +-struct is_signed : public is_signed {}; +-template <> +-struct is_signed : public is_signed {}; +-template <> +-struct is_signed : public is_signed {}; +- + } // namespace std + + #endif // TENSORFLOW_TSL_FRAMEWORK_TYPE_TRAITS_H_