forked from mindspore-Ecosystem/mindspore
!13547 op type adapter
From: @liubuyu Reviewed-by: @zhoufeng54,@jjfeing Signed-off-by: @jjfeing
This commit is contained in:
commit
c520f3deef
|
@ -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_;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue