pool_op.h 1.8 KB
Newer Older
1
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
2 3 4 5 6 7 8 9 10 11 12 13 14

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. */

F
From00 已提交
15
#pragma once
16

Y
Yi Wang 已提交
17
#include "paddle/fluid/framework/op_registry.h"
18

19 20 21
namespace paddle {
namespace operators {

22 23 24 25
class PoolOp : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;

26 27 28
 protected:
  framework::OpKernelType GetExpectedKernelType(
      const framework::ExecutionContext& ctx) const override;
29 30

  framework::OpKernelType GetKernelTypeForVar(
31
      const std::string& var_name,
32
      const phi::DenseTensor& tensor,
33
      const framework::OpKernelType& expected_kernel_type) const override;
34 35 36 37 38 39
};

class PoolOpGrad : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;

40 41 42
 protected:
  framework::OpKernelType GetExpectedKernelType(
      const framework::ExecutionContext& ctx) const override;
43 44

  framework::OpKernelType GetKernelTypeForVar(
45
      const std::string& var_name,
46
      const phi::DenseTensor& tensor,
47
      const framework::OpKernelType& expected_kernel_type) const override;
48 49 50 51
};

class Pool2dOpMaker : public framework::OpProtoAndCheckerMaker {
 public:
Y
Yu Yang 已提交
52
  void Make() override;
53 54 55 56
};

class Pool3dOpMaker : public framework::OpProtoAndCheckerMaker {
 public:
Y
Yu Yang 已提交
57
  void Make() override;
58
};
59

60 61
}  // namespace operators
}  // namespace paddle