Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
comaniac committed Apr 10, 2020
1 parent e2b7a7e commit 13cfa83
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/relay/analysis/annotated_region_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void AnnotatedRegionSetNode::AddToRegion(AnnotatedRegion dest, const Expr& expr)
}
}

AnnotatedRegion AnnotatedRegionSetNode::MakeRegion(std::string target) {
AnnotatedRegion AnnotatedRegionSetNode::MakeRegion(const std::string& target) {
auto ret = regions_.emplace(AnnotatedRegion());
(*ret.first)->id_ = region_id_++;
(*ret.first)->target_ = target;
Expand Down
2 changes: 1 addition & 1 deletion src/relay/analysis/annotated_region_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class AnnotatedRegionSetNode : public Object {
*
* \return The new region.
*/
AnnotatedRegion MakeRegion(std::string target);
AnnotatedRegion MakeRegion(const std::string& target);

std::unordered_set<AnnotatedRegion, ObjectHash, ObjectEqual> regions_;
/*! \brief The next region ID to assign. */
Expand Down
7 changes: 4 additions & 3 deletions src/relay/transforms/annotate_target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ class AnnotateTargetWrapper : public ExprMutator {
// if it is in the target list.
Function func = Downcast<Function>(cn->op);
CHECK(func.defined());
auto comp_name = func->GetAttr<tir::StringImm>(attr::kComposite);
auto comp_name = func->GetAttr<String>(attr::kComposite);
if (comp_name.defined()) {
size_t i = comp_name->value.find('.');
std::string comp_name_str = comp_name;
size_t i = comp_name_str.find('.');
if (i != std::string::npos) {
std::string comp_target = comp_name->value.substr(0, i);
std::string comp_target = comp_name_str.substr(0, i);
for (const auto& target : this->targets_) {
if (std::string(target) == comp_target) {
supported_targets.push_back(comp_target);
Expand Down
4 changes: 0 additions & 4 deletions tests/python/relay/test_pass_annotate_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,6 @@ def before():

if __name__ == "__main__":
test_extern_dnnl()
<<<<<<< HEAD
#test_extern_dnnl_mobilenet()
=======
>>>>>>> Skip e2e test
test_composite_function()
#test_extern_dnnl_mobilenet()
test_multiple_ends()
Expand Down

0 comments on commit 13cfa83

Please sign in to comment.