diff --git a/tensorflow/contrib/makefile/tf_op_files.txt b/tensorflow/contrib/makefile/tf_op_files.txt index d233fe63bad..eb9865dc43d 100644 --- a/tensorflow/contrib/makefile/tf_op_files.txt +++ b/tensorflow/contrib/makefile/tf_op_files.txt @@ -246,6 +246,7 @@ tensorflow/core/kernels/slice_op_cpu_impl_4.cc tensorflow/core/kernels/slice_op_cpu_impl_5.cc tensorflow/core/kernels/slice_op_cpu_impl_6.cc tensorflow/core/kernels/slice_op_cpu_impl_7.cc +tensorflow/core/kernels/slice_op_cpu_impl_8.cc tensorflow/core/kernels/softmax_op.cc tensorflow/core/kernels/softplus_op.cc tensorflow/core/kernels/softsign_op.cc @@ -274,6 +275,7 @@ tensorflow/core/kernels/strided_slice_op_inst_4.cc tensorflow/core/kernels/strided_slice_op_inst_5.cc tensorflow/core/kernels/strided_slice_op_inst_6.cc tensorflow/core/kernels/strided_slice_op_inst_7.cc +tensorflow/core/kernels/strided_slice_op_inst_8.cc tensorflow/core/kernels/string_join_op.cc tensorflow/core/kernels/string_util.cc tensorflow/core/kernels/tensor_array.cc diff --git a/tensorflow/core/kernels/BUILD b/tensorflow/core/kernels/BUILD index c5c736aa2a7..58cc16c6ced 100644 --- a/tensorflow/core/kernels/BUILD +++ b/tensorflow/core/kernels/BUILD @@ -138,6 +138,7 @@ tf_kernel_library( "strided_slice_op_inst_5.cc", "strided_slice_op_inst_6.cc", "strided_slice_op_inst_7.cc", + "strided_slice_op_inst_8.cc", ], hdrs = [ "slice_op.h", @@ -6122,6 +6123,7 @@ filegroup( "slice_op_cpu_impl_5.cc", "slice_op_cpu_impl_6.cc", "slice_op_cpu_impl_7.cc", + "slice_op_cpu_impl_8.cc", "softmax_op.cc", "softmax_op_functor.h", "split_lib.h", @@ -6139,6 +6141,7 @@ filegroup( "strided_slice_op_inst_5.cc", "strided_slice_op_inst_6.cc", "strided_slice_op_inst_7.cc", + "strided_slice_op_inst_8.cc", "unpack_op.cc", "variable_ops.cc", "variable_ops.h", diff --git a/tensorflow/core/kernels/pad_op.cc b/tensorflow/core/kernels/pad_op.cc index dd1fa86b0dd..a9d8e591e14 100644 --- a/tensorflow/core/kernels/pad_op.cc +++ b/tensorflow/core/kernels/pad_op.cc @@ -52,7 +52,7 @@ class PadOp : public OpKernel { const Tensor& in1 = context->input(1); const int dims = in0.dims(); static const int kMinDims = 0; - static const int kMaxDims = 6; + static const int kMaxDims = 8; OP_REQUIRES(context, kMinDims <= dims && dims <= kMaxDims, errors::Unimplemented("inputs rank not in [", kMinDims, ",", kMaxDims, "]: ", dims)); diff --git a/tensorflow/core/kernels/pad_op_gpu.cu.cc b/tensorflow/core/kernels/pad_op_gpu.cu.cc index ddc12417a91..2ef238af9d5 100644 --- a/tensorflow/core/kernels/pad_op_gpu.cu.cc +++ b/tensorflow/core/kernels/pad_op_gpu.cu.cc @@ -34,7 +34,9 @@ typedef Eigen::GpuDevice GPUDevice; template struct functor::Pad<GPUDevice, T, Tpadding, 3>; \ template struct functor::Pad<GPUDevice, T, Tpadding, 4>; \ template struct functor::Pad<GPUDevice, T, Tpadding, 5>; \ - template struct functor::Pad<GPUDevice, T, Tpadding, 6>; + template struct functor::Pad<GPUDevice, T, Tpadding, 6>; \ + template struct functor::Pad<GPUDevice, T, Tpadding, 7>; \ + template struct functor::Pad<GPUDevice, T, Tpadding, 8>; #define DEFINE_GPU_SPECS(T) \ DEFINE_GPU_PAD_SPECS(T, int32) \ diff --git a/tensorflow/core/kernels/slice_op.cc b/tensorflow/core/kernels/slice_op.cc index 1ac89b07c77..15f7157db07 100644 --- a/tensorflow/core/kernels/slice_op.cc +++ b/tensorflow/core/kernels/slice_op.cc @@ -202,6 +202,7 @@ class SliceOp : public OpKernel { HANDLE_DIM(5); HANDLE_DIM(6); HANDLE_DIM(7); + HANDLE_DIM(8); #undef HANDLE_DIM @@ -247,7 +248,8 @@ namespace functor { DECLARE_CPU_SPEC(T, 4); \ DECLARE_CPU_SPEC(T, 5); \ DECLARE_CPU_SPEC(T, 6); \ - DECLARE_CPU_SPEC(T, 7); + DECLARE_CPU_SPEC(T, 7); \ + DECLARE_CPU_SPEC(T, 8); TF_CALL_ALL_TYPES(DECLARE_FOR_N); @@ -286,7 +288,8 @@ namespace functor { DECLARE_GPU_SPEC(T, 4); \ DECLARE_GPU_SPEC(T, 5); \ DECLARE_GPU_SPEC(T, 6); \ - DECLARE_GPU_SPEC(T, 7); + DECLARE_GPU_SPEC(T, 7); \ + DECLARE_GPU_SPEC(T, 8); TF_CALL_GPU_NUMBER_TYPES(DECLARE_FOR_N); TF_CALL_complex64(DECLARE_FOR_N); @@ -352,7 +355,8 @@ namespace functor { DECLARE_SYCL_SPEC(T, 4); \ DECLARE_SYCL_SPEC(T, 5); \ DECLARE_SYCL_SPEC(T, 6); \ - DECLARE_SYCL_SPEC(T, 7); + DECLARE_SYCL_SPEC(T, 7); \ + DECLARE_SYCL_SPEC(T, 8); TF_CALL_GPU_NUMBER_TYPES_NO_HALF(DECLARE_FOR_N); DECLARE_FOR_N(int32); diff --git a/tensorflow/core/kernels/slice_op_cpu_impl_8.cc b/tensorflow/core/kernels/slice_op_cpu_impl_8.cc new file mode 100644 index 00000000000..0d4d656a7d0 --- /dev/null +++ b/tensorflow/core/kernels/slice_op_cpu_impl_8.cc @@ -0,0 +1,18 @@ +/* Copyright 2017 The TensorFlow Authors. 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. +==============================================================================*/ + +#define CPU_PROVIDED_IXDIM 8 +#include "tensorflow/core/kernels/slice_op_cpu_impl.h" +#undef CPU_PROVIDED_IXDIM diff --git a/tensorflow/core/kernels/slice_op_gpu.cu.cc b/tensorflow/core/kernels/slice_op_gpu.cu.cc index f76eab04e11..5a9d2ff950a 100644 --- a/tensorflow/core/kernels/slice_op_gpu.cu.cc +++ b/tensorflow/core/kernels/slice_op_gpu.cu.cc @@ -34,7 +34,8 @@ typedef Eigen::GpuDevice GPUDevice; template struct functor::Slice<GPUDevice, T, 4>; \ template struct functor::Slice<GPUDevice, T, 5>; \ template struct functor::Slice<GPUDevice, T, 6>; \ - template struct functor::Slice<GPUDevice, T, 7>; + template struct functor::Slice<GPUDevice, T, 7>; \ + template struct functor::Slice<GPUDevice, T, 8>; TF_CALL_GPU_NUMBER_TYPES(DEFINE_GPU_KERNELS); TF_CALL_complex64(DEFINE_GPU_KERNELS); diff --git a/tensorflow/core/kernels/strided_slice_op.cc b/tensorflow/core/kernels/strided_slice_op.cc index 2e6a26456c2..dd23c251897 100644 --- a/tensorflow/core/kernels/strided_slice_op.cc +++ b/tensorflow/core/kernels/strided_slice_op.cc @@ -170,6 +170,7 @@ class StridedSliceOp : public OpKernel { HANDLE_DIM(5); HANDLE_DIM(6); HANDLE_DIM(7); + HANDLE_DIM(8); #undef HANDLE_DIM @@ -268,6 +269,7 @@ class StridedSliceGradOp : public OpKernel { HANDLE_DIM(5); HANDLE_DIM(6); HANDLE_DIM(7); + HANDLE_DIM(8); #undef HANDLE_DIM } @@ -384,6 +386,7 @@ class StridedSliceAssignOp : public OpKernel { HANDLE_DIM(5); HANDLE_DIM(6); HANDLE_DIM(7); + HANDLE_DIM(8); #undef HANDLE_DIM OP_REQUIRES(context, false, diff --git a/tensorflow/core/kernels/strided_slice_op_gpu_impl.h b/tensorflow/core/kernels/strided_slice_op_gpu_impl.h index f451fe4bb7a..23a3ff8606e 100644 --- a/tensorflow/core/kernels/strided_slice_op_gpu_impl.h +++ b/tensorflow/core/kernels/strided_slice_op_gpu_impl.h @@ -38,6 +38,7 @@ typedef Eigen::GpuDevice GPUDevice; template struct functor::StridedSlice<GPUDevice, T, 5>; \ template struct functor::StridedSlice<GPUDevice, T, 6>; \ template struct functor::StridedSlice<GPUDevice, T, 7>; \ + template struct functor::StridedSlice<GPUDevice, T, 8>; \ template struct functor::StridedSliceGrad<GPUDevice, T, 1>; \ template struct functor::StridedSliceGrad<GPUDevice, T, 2>; \ template struct functor::StridedSliceGrad<GPUDevice, T, 3>; \ @@ -45,6 +46,7 @@ typedef Eigen::GpuDevice GPUDevice; template struct functor::StridedSliceGrad<GPUDevice, T, 5>; \ template struct functor::StridedSliceGrad<GPUDevice, T, 6>; \ template struct functor::StridedSliceGrad<GPUDevice, T, 7>; \ + template struct functor::StridedSliceGrad<GPUDevice, T, 8>; \ template struct functor::StridedSliceAssign<GPUDevice, T, 1>; \ template struct functor::StridedSliceAssign<GPUDevice, T, 2>; \ template struct functor::StridedSliceAssign<GPUDevice, T, 3>; \ @@ -52,6 +54,7 @@ typedef Eigen::GpuDevice GPUDevice; template struct functor::StridedSliceAssign<GPUDevice, T, 5>; \ template struct functor::StridedSliceAssign<GPUDevice, T, 6>; \ template struct functor::StridedSliceAssign<GPUDevice, T, 7>; \ + template struct functor::StridedSliceAssign<GPUDevice, T, 8>; \ template struct functor::StridedSliceAssignScalar<GPUDevice, T>; } // end namespace tensorflow diff --git a/tensorflow/core/kernels/strided_slice_op_inst_8.cc b/tensorflow/core/kernels/strided_slice_op_inst_8.cc new file mode 100644 index 00000000000..83dfd9b49a2 --- /dev/null +++ b/tensorflow/core/kernels/strided_slice_op_inst_8.cc @@ -0,0 +1,23 @@ +/* Copyright 2017 The TensorFlow Authors. 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. +==============================================================================*/ + +#define EIGEN_USE_THREADS +#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM +#define EIGEN_USE_GPU +#endif + +#define STRIDED_SLICE_INSTANTIATE_DIM 8 +#include "tensorflow/core/kernels/strided_slice_op_impl.h" +#undef STRIDED_SLICE_INSTANTIATE_DIM