kernel_alias_name.h 1.9 KB
Newer Older
Y
YuanRisheng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/* Copyright (c) 2021 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. */

// TODO(yuanrisheng): this file may need to be removed
#pragma once

namespace pten {

// the key is kernel_name in fluid, the value is the kernel_name in pten
// the key is sorted by key's alphabet
const std::unordered_map<std::string, std::string> kernel_alias_name_map = {
23 24 25 26
    {"elementwise_add", "add_raw"},
    {"elementwise_div", "divide_raw"},
    {"elementwise_mul", "muliply_raw"},
    {"elementwise_sub", "subtract_raw"},
Y
YuanRisheng 已提交
27 28 29
    {"fill_any_like", "full_like"},
    {"fill_constant", "full"},
    {"flatten_contiguous_range", "flatten"},
30
    {"flatten_contiguous_range_grad", "flatten_grad"},
31
    {"matmul_v2", "matmul"},
32 33 34
    {"matmul_v2_grad", "matmul_grad"},
    {"matmul_v2_grad_grad", "matmul_double_grad"},
    {"matmul_v2_triple_grad", "matmul_triple_grad"},
35 36
    {"reduce_mean", "mean_raw"},
    {"reduce_sum", "sum_raw"},
Y
YuanRisheng 已提交
37
    {"reshape2", "reshape"},
38 39
    {"reshape2_grad", "reshape_grad"},
    {"reshape2_grad_grad", "reshape_double_grad"},
Y
YuanRisheng 已提交
40 41
    // fluid kernel "mean/reshape/matmul/flatten/sum" should be deprecated
    {"flatten", "deprecated"},
42
    {"flatten_grad", "deprecated"},
43
    {"matmul", "deprecated"},
44 45
    {"matmul_grad", "deprecated"},
    {"matmul_grad_grad", "deprecated"},
Y
YuanRisheng 已提交
46 47
    {"mean", "deprecated"},
    {"reshape", "deprecated"},
48
    {"reshape_grad", "deprecated"},
Y
YuanRisheng 已提交
49 50 51
    {"sum", "deprecated"}};

}  // namespace pten