1/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#ifndef TENSORFLOW_CORE_KERNELS_SPLIT_LIB_H_
17#define TENSORFLOW_CORE_KERNELS_SPLIT_LIB_H_
18// Functor definition for SplitOp, must be compilable by nvcc.
19
20#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
21#include "tensorflow/core/framework/tensor_types.h"
22
23namespace tensorflow {
24namespace functor {
25
26template <typename Device, typename T>
27struct SplitCustom {
28 void operator()(const Device& d, typename TTypes<T, 2>::Tensor output,
29 typename TTypes<T, 2>::ConstTensor input,
30 const Eigen::DSizes<Eigen::DenseIndex, 2>& slice_indices,
31 const Eigen::DSizes<Eigen::DenseIndex, 2>& slice_sizes);
32};
33
34template <typename Device, typename T, int NDims>
35struct Split {
36 void operator()(const Device& d, typename TTypes<T, NDims>::Tensor output,
37 typename TTypes<T, NDims>::ConstTensor input,
38 const Eigen::DSizes<Eigen::DenseIndex, NDims>& slice_indices,
39 const Eigen::DSizes<Eigen::DenseIndex, NDims>& slice_sizes);
40};
41
42template <typename T, int NDims>
43struct Split<Eigen::ThreadPoolDevice, T, NDims> {
44 void operator()(const Eigen::ThreadPoolDevice& d,
45 typename TTypes<T, NDims>::Tensor output,
46 typename TTypes<T, NDims>::ConstTensor input,
47 const Eigen::DSizes<Eigen::DenseIndex, NDims>& slice_indices,
48 const Eigen::DSizes<Eigen::DenseIndex, NDims>& slice_sizes);
49};
50
51
52} // namespace functor
53} // namespace tensorflow
54
55#endif // TENSORFLOW_CORE_KERNELS_SPLIT_LIB_H_
56