aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tensorflow/core/kernels/constant_op.cc1
-rw-r--r--tensorflow/python/kernel_tests/constant_op_test.py9
2 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/constant_op.cc b/tensorflow/core/kernels/constant_op.cc
index be7a7a41a4..97608938a4 100644
--- a/tensorflow/core/kernels/constant_op.cc
+++ b/tensorflow/core/kernels/constant_op.cc
@@ -155,6 +155,7 @@ class FillOp : public OpKernel {
#define REGISTER_CPU_KERNEL(TYPE) REGISTER_KERNEL(CPU, TYPE)
TF_CALL_ALL_TYPES(REGISTER_CPU_KERNEL);
+REGISTER_KERNEL(CPU, quint8);
#undef REGISTER_CPU_KERNEL
#if GOOGLE_CUDA
diff --git a/tensorflow/python/kernel_tests/constant_op_test.py b/tensorflow/python/kernel_tests/constant_op_test.py
index 71ffe8c61d..430f9e810a 100644
--- a/tensorflow/python/kernel_tests/constant_op_test.py
+++ b/tensorflow/python/kernel_tests/constant_op_test.py
@@ -491,6 +491,15 @@ class FillTest(tf.test.TestCase):
np_ans = np.array([[0.15] * 3] * 2).astype(np.complex128)
self._compare([2, 3], np_ans[0][0], np_ans, use_gpu=False)
+ def testFillQUint8(self):
+ np_ans = np.array([[42] * 3] * 2).astype(np.uint8)
+ with self.test_session(use_gpu=False):
+ val = tf.placeholder(dtype=tf.quint8, shape=())
+ tf_ans = tf.fill([2,3], val, name="fill")
+ out = tf_ans.eval(
+ feed_dict={val: np.array([42]).reshape([]).astype(np.uint8)})
+ self.assertAllClose(np_ans, out)
+
def testFillString(self):
np_ans = np.array([[b"yolo"] * 3] * 2)
with self.test_session(use_gpu=False):