aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/cc/ops
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <nobody@tensorflow.org>2016-03-29 01:52:01 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-03-29 03:04:17 -0700
commitb6d66ffda925bad1741aee0cee1e07d3546364ac (patch)
tree816122214c9469529c629de0a0be6284bbb28f83 /tensorflow/cc/ops
parentcac50c3227aa6c3ef6b7ccaa40548ed7f93cf71a (diff)
Add half support for the first basic ops, namely Cast and Const.
Change: 118445207
Diffstat (limited to 'tensorflow/cc/ops')
-rw-r--r--tensorflow/cc/ops/const_op.cc2
-rw-r--r--tensorflow/cc/ops/const_op.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/cc/ops/const_op.cc b/tensorflow/cc/ops/const_op.cc
index ddfa2a5b0e..5f5680e54e 100644
--- a/tensorflow/cc/ops/const_op.cc
+++ b/tensorflow/cc/ops/const_op.cc
@@ -84,6 +84,8 @@ DEFINE_CONST(int8, int_val);
DEFINE_CONST(int64, int64_val);
DEFINE_CONST(bool, bool_val);
+DEFINE_CONST_IMPL(Eigen::half, proto.add_half_val(t.begin()->x));
+
DEFINE_CONST_IMPL(complex64, proto.add_scomplex_val(t.begin()->real());
proto.add_scomplex_val(t.begin()->imag()););
diff --git a/tensorflow/cc/ops/const_op.h b/tensorflow/cc/ops/const_op.h
index 0a1ee3f1e0..f29e2ab3da 100644
--- a/tensorflow/cc/ops/const_op.h
+++ b/tensorflow/cc/ops/const_op.h
@@ -42,6 +42,7 @@ namespace ops {
return Const(gtl::ArraySlice<TYPE>(t), shape, options); \
}
+DECLARE_CONST(Eigen::half);
DECLARE_CONST(float);
DECLARE_CONST(double);
DECLARE_CONST(int32);