Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
comaniac committed Jul 10, 2020
1 parent 12312f5 commit b012904
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/relay/backend/contrib/codegen_json/codegen_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class OpAttrExtractor : public AttrVisitor {
attr.push_back(Fp2String(fm->value));
} else if (const auto* str = (*an)[i].as<StringObj>()) {
String s = GetRef<String>(str);
attr.push_back(s.operator std::string());
attr.push_back(s);
} else {
LOG(FATAL) << "Not supported type: " << (*an)[i]->GetTypeKey();
}
Expand All @@ -118,7 +118,7 @@ class OpAttrExtractor : public AttrVisitor {
SetNodeAttr(key, std::vector<std::string>{Fp2String(fm->value)});
} else if (const auto* str = (*value).as<StringObj>()) {
String s = GetRef<String>(str);
SetNodeAttr(key, std::vector<std::string>{s.operator std::string()});
SetNodeAttr(key, std::vector<std::string>{s});
} else {
LOG(FATAL) << "Not yet supported type: " << (*value)->GetTypeKey() << ": " << *value;
}
Expand Down Expand Up @@ -230,7 +230,7 @@ class JSONSerializer : public MemoizedExprTranslator<std::vector<JSONGraphNodeEn
auto pattern = fn->GetAttr<String>(attr::kPartitionedFromPattern);
CHECK(pattern.defined());
std::vector<std::string> values;
values.push_back(pattern.value().operator std::string());
values.push_back(pattern.value());
std::vector<dmlc::any> attr;
attr.emplace_back(values);
node->SetAttr("PartitionedFromPattern", attr);
Expand Down Expand Up @@ -271,7 +271,7 @@ class JSONSerializer : public MemoizedExprTranslator<std::vector<JSONGraphNodeEn
} else if (const auto* fn = cn->op.as<FunctionNode>()) {
auto comp = fn->GetAttr<String>(attr::kComposite);
CHECK(comp.defined()) << "JSON runtime only supports composite functions.";
name = comp.value().operator std::string();
name = comp.value();
} else {
LOG(FATAL) << "JSON runtime does not support calls to " << cn->op->GetTypeKey();
}
Expand Down
2 changes: 1 addition & 1 deletion src/relay/backend/contrib/dnnl/codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ class DNNLJSONSerializer : public backend::contrib::JSONSerializer {
} else if (const auto* fn = cn->op.as<FunctionNode>()) {
auto comp = fn->GetAttr<String>(attr::kComposite);
CHECK(comp.defined()) << "DNNL JSON runtime only supports composite functions.";
name = comp.value().operator std::string();
name = comp.value();

if (name == "dnnl.conv2d_bias_relu") {
call = GetRootCall(fn->body.as<CallNode>(), 2, {"nn.conv2d", "add", "nn.relu"});
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/contrib/dnnl/dnnl_json_runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class DNNLJSONRuntime : public JSONRuntimeBase {
size_t offset = 0) {
auto eid = EntryID(entry);
// Since the DNNL memory has been created before calling this function, we assume the entry
// has not yet been bind to the other DNNL memory; otherwise it may have memory leak.
// has not yet been bound to the other DNNL memory; otherwise it may have memory leak.
CHECK_EQ(entry_out_mem_.count(eid), 0);

// TODO(@comanic): Support other data types (i.e., int8).
Expand Down

0 comments on commit b012904

Please sign in to comment.