diff options
author | 2016-03-17 14:41:42 -0800 | |
---|---|---|
committer | 2016-03-18 08:46:24 -0700 | |
commit | f27c3ba3f667337de7bcb9e0188b00cee96c6974 (patch) | |
tree | bb51f681e6b4e13aca483180c988a4992ab35497 /tensorflow/core/kernels/depthtospace_op.h | |
parent | addfb7af657ed75f24099fe7362a8a7ba6dfa7f3 (diff) |
GPU implementations of space_to_depth and depth_to_space.
Change: 117493386
Diffstat (limited to 'tensorflow/core/kernels/depthtospace_op.h')
-rw-r--r-- | tensorflow/core/kernels/depthtospace_op.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/depthtospace_op.h b/tensorflow/core/kernels/depthtospace_op.h new file mode 100644 index 0000000000..60c347d985 --- /dev/null +++ b/tensorflow/core/kernels/depthtospace_op.h @@ -0,0 +1,44 @@ +/* Copyright 2015 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. +==============================================================================*/ + +#ifndef TENSORFLOW_CORE_KERNELS_DEPTHTOSPACE_OP_H_ +#define TENSORFLOW_CORE_KERNELS_DEPTHTOSPACE_OP_H_ +// Functor definition for XentOp, must be compilable by nvcc. + +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" + +namespace tensorflow { +namespace functor { + +// Functor used by DepthToSpaceOp to do the computations. +template <typename Device, typename T> +struct DepthToSpaceOpFunctor { + // Implements the depth to space conversion. + // + // input: 4-D input tensor. + // block_size: block size for the conversion. + // output: 4-D output tensor. + // + // The dimensions of the tensors are guaranteed to be correct when the + // functor is called. + void operator()(const Device& d, typename TTypes<T, 4>::ConstTensor input, + int block_size, typename TTypes<T, 4>::Tensor output); +}; + +} // namespace functor +} // namespace tensorflow + +#endif // TENSORFLOW_CORE_KERNELS_DEPTHTOSPACE_OP_H_ |