conv3d_sig.cc 2.5 KB
Newer Older
H
hong 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// Copyright (c) 2022 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/phi/core/compat/op_utils.h"

namespace phi {

G
Galaxy1458 已提交
19 20
KernelSignature Conv3dOpArgumentMapping(
    const ArgumentMappingContext& ctx UNUSED) {
H
hong 已提交
21 22
  return KernelSignature("conv3d",
                         {"Input", "Filter"},
23 24 25 26 27 28 29 30
                         {
                             "strides",
                             "paddings",
                             "padding_algorithm",
                             "groups",
                             "dilations",
                             "data_format",
                         },
H
hong 已提交
31 32 33
                         {"Output"});
}

G
Galaxy1458 已提交
34 35
KernelSignature Conv3dGradOpArgumentMapping(
    const ArgumentMappingContext& ctx UNUSED) {
A
Aganlengzi 已提交
36
  return KernelSignature("conv3d_grad",
37
                         {"Input", "Filter", "Output@GRAD"},
H
hong 已提交
38 39 40 41 42
                         {"strides",
                          "paddings",
                          "padding_algorithm",
                          "groups",
                          "dilations",
43
                          "data_format"},
44
                         {"Input@GRAD", "Filter@GRAD"});
H
hong 已提交
45 46 47
}

KernelSignature Conv3dDoubleGradOpArgumentMapping(
G
Galaxy1458 已提交
48
    const ArgumentMappingContext& ctx UNUSED) {
49
  return KernelSignature("conv3d_double_grad",
50
                         {"Input", "Filter", "DOutput", "DDInput", "DDFilter"},
H
hong 已提交
51 52 53 54 55
                         {"strides",
                          "paddings",
                          "padding_algorithm",
                          "groups",
                          "dilations",
56
                          "data_format"},
57
                         {"DInput", "DFilter", "DDOutput"});
H
hong 已提交
58 59 60 61
}

}  // namespace phi

62 63
PD_REGISTER_BASE_KERNEL_NAME(conv3d_grad_grad, conv3d_double_grad);

H
hong 已提交
64 65 66 67
PD_REGISTER_ARG_MAPPING_FN(conv3d, phi::Conv3dOpArgumentMapping);
PD_REGISTER_ARG_MAPPING_FN(conv3d_grad, phi::Conv3dGradOpArgumentMapping);
PD_REGISTER_ARG_MAPPING_FN(conv3d_grad_grad,
                           phi::Conv3dDoubleGradOpArgumentMapping);