diff --git a/paddle/fluid/operators/random_crop_op.cc b/paddle/fluid/operators/random_crop_op.cc index d92b8bbbb58f25513489967f9739caeafc29db6a..b14b559e31dd422f8ebe4002988a9746dfdf28a2 100644 --- a/paddle/fluid/operators/random_crop_op.cc +++ b/paddle/fluid/operators/random_crop_op.cc @@ -74,8 +74,8 @@ namespace ops = paddle::operators; namespace f = paddle::framework; REGISTER_OPERATOR(random_crop, ops::RandomCropOp, ops::RandomCropOpMaker, ops::RandomCropOpInferShape, f::EmptyGradOpMaker); + template using Kernel = ops::RandomCropKernel; - REGISTER_OP_CPU_KERNEL(random_crop, Kernel, Kernel, Kernel, Kernel, Kernel); diff --git a/paddle/fluid/operators/random_crop_op.cu b/paddle/fluid/operators/random_crop_op.cu new file mode 100644 index 0000000000000000000000000000000000000000..2782911b4fefc6f7cd37abc6df79a03803c8d07b --- /dev/null +++ b/paddle/fluid/operators/random_crop_op.cu @@ -0,0 +1,20 @@ +// Copyright (c) 2018 PaddlePaddle 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. + +#include "paddle/fluid/operators/random_crop_op.h" + +template +using Kernel = ops::RandomCropKernel; +REGISTER_OP_CUDA_KERNEL(random_crop, Kernel, Kernel, Kernel, + Kernel, Kernel);