!13547 op type adapter

From: @liubuyu
Reviewed-by: @zhoufeng54,@jjfeing
Signed-off-by: @jjfeing
This commit is contained in:
mindspore-ci-bot 2021-03-18 21:33:16 +08:00 committed by Gitee
commit c520f3deef
2 changed files with 6 additions and 0 deletions

View File

@ -165,6 +165,10 @@ bool TbeKernelJsonCreator::GenTbeSingleKernelJson(const std::shared_ptr<mindspor
op_info_json[kJFullName] = anf_node->fullname_with_scope();
json_name_ = op_name + "_" + std::to_string(hash_id) + "_" + std::to_string(device_id);
json_info_ = json_str;
auto iter = tbe::opTypeAdapter.find(op_name);
if (iter != tbe::opTypeAdapter.end()) {
op_name = iter->second;
}
op_info_json["Type"] = op_name;
op_info_json["graph_id"] = AnfAlgo::GetGraphId(anf_node.get());
op_info_json[kJKernelName] = json_name_;

View File

@ -33,6 +33,8 @@ namespace kernel {
namespace tbe {
using std::string;
using std::vector;
const std::map<std::string, std::string> opTypeAdapter = {
{"ReLUV2", "ReluV2"}, {"ReLU6", "Relu6"}, {"ReLU6Grad", "Relu6Grad"}, {"ReLUGrad", "ReluGrad"}, {"ReLU", "Relu"}};
class TbeUtils {
public: