aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/fill_functor.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/kernels/fill_functor.h')
-rw-r--r--tensorflow/core/kernels/fill_functor.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/fill_functor.h b/tensorflow/core/kernels/fill_functor.h
new file mode 100644
index 0000000000..831f0c899e
--- /dev/null
+++ b/tensorflow/core/kernels/fill_functor.h
@@ -0,0 +1,26 @@
+#ifndef TENSORFLOW_KERNELS_FILL_FUNCTOR_H_
+#define TENSORFLOW_KERNELS_FILL_FUNCTOR_H_
+
+#include "tensorflow/core/framework/tensor_types.h"
+#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
+
+namespace tensorflow {
+namespace functor {
+
+template <typename Device, typename T>
+struct FillFunctor {
+ // Computes on device "d": out = out.constant(in(0)),
+ void operator()(const Device& d, typename TTypes<T>::Flat out,
+ typename TTypes<T>::ConstScalar in);
+};
+
+template <typename Device, typename T>
+struct SetZeroFunctor {
+ // Computes on device "d": out = out.setZero(),
+ void operator()(const Device& d, typename TTypes<T>::Flat out);
+};
+
+} // namespace functor
+} // namespace tensorflow
+
+#endif // TENSORFLOW_KERNELS_FILL_FUNCTOR_H_