Add uint32/uint64 support for tf.tile

This PR tries to address the issue raised in 39405 where
there is no uint32/uint64 support for tf.tile.

The related kernel impl for uint32 and uint64 has been added in this PR.

This PR fixes 39405

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2020-05-11 17:44:32 +00:00
parent ae76544efc
commit 764e3a790e
4 changed files with 66 additions and 0 deletions

View File

@ -1337,6 +1337,8 @@ tf_kernel_library(
"tile_functor_cpu_int32.cc",
"tile_functor_cpu_int64.cc",
"tile_functor_cpu_int8.cc",
"tile_functor_cpu_uint32.cc",
"tile_functor_cpu_uint64.cc",
"tile_functor_cpu_tstring.cc",
"tile_functor_cpu_uint8.cc",
"tile_functor_sycl.cc",

View File

@ -0,0 +1,29 @@
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#define EIGEN_USE_THREADS
#include "tensorflow/core/kernels/tile_functor_cpu.h"
namespace tensorflow {
namespace functor {
typedef Eigen::ThreadPoolDevice CPUDevice;
template struct Tile<CPUDevice, uint32, int32>;
template struct Tile<CPUDevice, uint32, int64>;
} // end namespace functor
} // end namespace tensorflow

View File

@ -0,0 +1,29 @@
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#define EIGEN_USE_THREADS
#include "tensorflow/core/kernels/tile_functor_cpu.h"
namespace tensorflow {
namespace functor {
typedef Eigen::ThreadPoolDevice CPUDevice;
template struct Tile<CPUDevice, uint64, int32>;
template struct Tile<CPUDevice, uint64, int64>;
} // end namespace functor
} // end namespace tensorflow

View File

@ -139,6 +139,8 @@ TF_CALL_uint8(DECLARE_TYPE);
TF_CALL_int32(DECLARE_TYPE);
TF_CALL_int16(DECLARE_TYPE);
TF_CALL_int64(DECLARE_TYPE);
TF_CALL_uint32(DECLARE_TYPE);
TF_CALL_uint64(DECLARE_TYPE);
TF_CALL_half(DECLARE_TYPE);
TF_CALL_complex64(DECLARE_TYPE);
TF_CALL_complex128(DECLARE_TYPE);
@ -240,6 +242,8 @@ class TileOp : public OpKernel {
TF_CALL_int32(HANDLE_TYPE_NAME);
TF_CALL_int16(HANDLE_TYPE_NAME);
TF_CALL_int64(HANDLE_TYPE_NAME);
TF_CALL_uint32(HANDLE_TYPE_NAME);
TF_CALL_uint64(HANDLE_TYPE_NAME);
TF_CALL_half(HANDLE_TYPE_NAME);
TF_CALL_tstring(HANDLE_TYPE_NAME); // when DEVICE=CPUDevice.
TF_CALL_complex64(HANDLE_TYPE_NAME);
@ -319,6 +323,8 @@ TF_CALL_int8(HANDLE_TYPE_NAME_CPU);
TF_CALL_int32(HANDLE_TYPE_NAME_CPU);
TF_CALL_int16(HANDLE_TYPE_NAME_CPU);
TF_CALL_int64(HANDLE_TYPE_NAME_CPU);
TF_CALL_uint32(HANDLE_TYPE_NAME_CPU);
TF_CALL_uint64(HANDLE_TYPE_NAME_CPU);
TF_CALL_half(HANDLE_TYPE_NAME_CPU);
TF_CALL_complex64(HANDLE_TYPE_NAME_CPU);
TF_CALL_complex128(HANDLE_TYPE_NAME_CPU);