aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/cwise_op_rint.cc
diff options
context:
space:
mode:
authorGravatar Fabrizio Milo <Mistobaan@users.noreply.github.com>2016-11-16 10:05:20 -0800
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2016-11-16 10:05:20 -0800
commit8f32013de36fe259be7d5536778550dbc9cca8a4 (patch)
treebfd0e181e58d886030cb5ed8195c49e9ef9d4756 /tensorflow/core/kernels/cwise_op_rint.cc
parentd1060ca234ff00349a46c583218bc2d9fa72b63d (diff)
add Rint operation (#4113)
* add rint op * wip on custom rounding op * fix Makefile build for the rint op * rebase, add test, fix examples
Diffstat (limited to 'tensorflow/core/kernels/cwise_op_rint.cc')
-rw-r--r--tensorflow/core/kernels/cwise_op_rint.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/cwise_op_rint.cc b/tensorflow/core/kernels/cwise_op_rint.cc
new file mode 100644
index 0000000000..a741b3d718
--- /dev/null
+++ b/tensorflow/core/kernels/cwise_op_rint.cc
@@ -0,0 +1,23 @@
+/* Copyright 2016 Google Inc. 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.
+==============================================================================*/
+
+#include "tensorflow/core/kernels/cwise_ops_common.h"
+
+namespace tensorflow {
+REGISTER2(UnaryOp, CPU, "Rint", functor::rint, float, double);
+#if GOOGLE_CUDA
+REGISTER2(UnaryOp, GPU, "Rint", functor::rint, float, double);
+#endif
+} // namespace tensorflow