Merge pull request from yongtang:17823-pad-uint8-gpu

PiperOrigin-RevId: 230738469
This commit is contained in:
TensorFlower Gardener 2019-01-24 10:07:58 -08:00
commit e45971094d
3 changed files with 4 additions and 1 deletions
tensorflow
core/kernels
python/kernel_tests

View File

@ -322,6 +322,7 @@ namespace functor {
TF_CALL_GPU_ALL_TYPES(DECLARE_GPU_SPECS);
TF_CALL_int8(DECLARE_GPU_SPECS);
TF_CALL_uint8(DECLARE_GPU_SPECS);
} // namespace functor
// Registration of the GPU implementations.
@ -355,6 +356,7 @@ TF_CALL_int8(DECLARE_GPU_SPECS);
TF_CALL_GPU_ALL_TYPES(REGISTER_GPU_KERNEL);
TF_CALL_int8(REGISTER_GPU_KERNEL);
TF_CALL_uint8(REGISTER_GPU_KERNEL);
// A special GPU kernel for int32.
// TODO(b/25387198): Also enable int32 in device memory. This kernel

View File

@ -41,6 +41,7 @@ typedef Eigen::GpuDevice GPUDevice;
TF_CALL_GPU_ALL_TYPES(DEFINE_GPU_SPECS);
TF_CALL_int8(DEFINE_GPU_SPECS);
TF_CALL_uint8(DEFINE_GPU_SPECS);
} // namespace tensorflow

View File

@ -223,7 +223,7 @@ class PadOpTest(test.TestCase):
def testIntTypes(self):
# TODO(touts): Figure out why the padding tests do not work on GPU
# for int types and rank > 2.
for t in [np.int8, np.int32, np.int64]:
for t in [np.int8, np.uint8, np.int32, np.int64]:
self._testAll(
np.random.randint(-100, 100, (4, 4, 3)).astype(t),
[[1, 0], [2, 3], [0, 2]], 0)