Skip to content

Commit

Permalink
[Phi] Move grid sample op kernel into phi (#40585)
Browse files Browse the repository at this point in the history
* add grid sample phi kernel

* add grid sample phi kernel and remove original kernel

* replace mutable_data by alloc
  • Loading branch information
chenwhql authored Mar 16, 2022
1 parent ad81f22 commit 8fd20b5
Show file tree
Hide file tree
Showing 12 changed files with 1,398 additions and 1,102 deletions.
11 changes: 1 addition & 10 deletions paddle/fluid/operators/grid_sampler_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ 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/grid_sampler_op.h"
#include <memory>
#include <string>

#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/op_version_registry.h"
#include "paddle/fluid/platform/device/gpu/gpu_dnn.h"
Expand Down Expand Up @@ -229,15 +229,6 @@ REGISTER_OPERATOR(grid_sampler, ops::GridSampleOp, ops::GridSampleOpMaker,
ops::GridSampleGradMaker<paddle::imperative::OpBase>);
REGISTER_OPERATOR(grid_sampler_grad, ops::GridSampleOpGrad);

REGISTER_OP_CPU_KERNEL(
grid_sampler,
ops::GridSampleOpKernel<paddle::platform::CPUDeviceContext, float>,
ops::GridSampleOpKernel<paddle::platform::CPUDeviceContext, double>);
REGISTER_OP_CPU_KERNEL(
grid_sampler_grad,
ops::GridSampleGradOpKernel<paddle::platform::CPUDeviceContext, float>,
ops::GridSampleGradOpKernel<paddle::platform::CPUDeviceContext, double>);

REGISTER_OP_VERSION(grid_sampler)
.AddCheckpoint(
R"ROC(
Expand Down
Loading

0 comments on commit 8fd20b5

Please sign in to comment.