From f75304271a8212a156fad59037b06c049e45e4ef Mon Sep 17 00:00:00 2001 From: Trevor Morris Date: Mon, 25 Mar 2024 13:46:22 -0700 Subject: [PATCH] Update eigen header locations for TF 2.16 --- .../custom_ops/image/cc/kernels/adjust_hsv_in_yiq_op.h | 6 ++++++ .../custom_ops/image/cc/kernels/connected_components.h | 5 +++++ .../image/cc/kernels/euclidean_distance_transform_op.h | 5 +++++ .../custom_ops/seq2seq/cc/kernels/beam_search_ops.cc | 5 +++++ .../custom_ops/seq2seq/cc/kernels/beam_search_ops.h | 5 +++++ 5 files changed, 26 insertions(+) diff --git a/tensorflow_addons/custom_ops/image/cc/kernels/adjust_hsv_in_yiq_op.h b/tensorflow_addons/custom_ops/image/cc/kernels/adjust_hsv_in_yiq_op.h index 33f3761fd7..3e60794af4 100644 --- a/tensorflow_addons/custom_ops/image/cc/kernels/adjust_hsv_in_yiq_op.h +++ b/tensorflow_addons/custom_ops/image/cc/kernels/adjust_hsv_in_yiq_op.h @@ -23,8 +23,14 @@ limitations under the License. #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" +#include "tensorflow/core/public/version.h" +#if TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION >= 16 +#include "Eigen/Core" +#include "unsupported/Eigen/CXX11/Tensor" +#else #include "third_party/eigen3/Eigen/Core" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#endif namespace tensorflow { namespace addons { diff --git a/tensorflow_addons/custom_ops/image/cc/kernels/connected_components.h b/tensorflow_addons/custom_ops/image/cc/kernels/connected_components.h index 6c032b3646..b595be88d7 100644 --- a/tensorflow_addons/custom_ops/image/cc/kernels/connected_components.h +++ b/tensorflow_addons/custom_ops/image/cc/kernels/connected_components.h @@ -26,8 +26,13 @@ limitations under the License. #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/platform/types.h" +#include "tensorflow/core/public/version.h" #include "tensorflow/core/util/work_sharder.h" +#if TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION >= 16 +#include "unsupported/Eigen/CXX11/Tensor" +#else #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#endif namespace tensorflow { namespace addons { diff --git a/tensorflow_addons/custom_ops/image/cc/kernels/euclidean_distance_transform_op.h b/tensorflow_addons/custom_ops/image/cc/kernels/euclidean_distance_transform_op.h index 974b59895b..6ef000663a 100755 --- a/tensorflow_addons/custom_ops/image/cc/kernels/euclidean_distance_transform_op.h +++ b/tensorflow_addons/custom_ops/image/cc/kernels/euclidean_distance_transform_op.h @@ -21,7 +21,12 @@ limitations under the License. #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/platform/types.h" +#include "tensorflow/core/public/version.h" +#if TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION >= 16 +#include "unsupported/Eigen/CXX11/Tensor" +#else #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#endif namespace tensorflow { namespace addons { diff --git a/tensorflow_addons/custom_ops/seq2seq/cc/kernels/beam_search_ops.cc b/tensorflow_addons/custom_ops/seq2seq/cc/kernels/beam_search_ops.cc index b1b07c5faa..ef93881b0d 100644 --- a/tensorflow_addons/custom_ops/seq2seq/cc/kernels/beam_search_ops.cc +++ b/tensorflow_addons/custom_ops/seq2seq/cc/kernels/beam_search_ops.cc @@ -32,8 +32,13 @@ limitations under the License. #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/macros.h" +#include "tensorflow/core/public/version.h" #include "tensorflow/core/util/work_sharder.h" +#if TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION >= 16 +#include "unsupported/Eigen/CXX11/Tensor" +#else #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#endif namespace tensorflow { namespace addons { diff --git a/tensorflow_addons/custom_ops/seq2seq/cc/kernels/beam_search_ops.h b/tensorflow_addons/custom_ops/seq2seq/cc/kernels/beam_search_ops.h index 2d6874f152..717d8212ee 100644 --- a/tensorflow_addons/custom_ops/seq2seq/cc/kernels/beam_search_ops.h +++ b/tensorflow_addons/custom_ops/seq2seq/cc/kernels/beam_search_ops.h @@ -18,7 +18,12 @@ limitations under the License. #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/platform/types.h" +#include "tensorflow/core/public/version.h" +#if TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION >= 16 +#include "unsupported/Eigen/CXX11/Tensor" +#else #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#endif namespace tensorflow { class OpKernelContext;