提交 ca629eb4 编写于 作者: S superjomn

remove Argument place in mir::Node

上级 b927e72f
...@@ -57,7 +57,6 @@ class Node { ...@@ -57,7 +57,6 @@ class Node {
struct Argument { struct Argument {
std::string name; std::string name;
Place place;
const Type* type; const Type* type;
// Weight is a special kind of argument, it is marked as weight explicitly // Weight is a special kind of argument, it is marked as weight explicitly
// so that some weight related optimization can take place. // so that some weight related optimization can take place.
......
...@@ -38,8 +38,8 @@ class VariablePlaceInferencePass : public DebugPass { ...@@ -38,8 +38,8 @@ class VariablePlaceInferencePass : public DebugPass {
continue; continue;
} }
auto& arg = v->AsArgument(); // auto& arg = v->AsArgument();
arg.place.target = argument_default_target_; // arg.place.target = argument_default_target_;
// the other place description can't be determined yet, until their first // the other place description can't be determined yet, until their first
// usage by some kernel. // usage by some kernel.
} }
...@@ -66,8 +66,7 @@ class VariablePlaceInferencePass : public DebugPass { ...@@ -66,8 +66,7 @@ class VariablePlaceInferencePass : public DebugPass {
auto* node = graph->RetrieveArgument(arg_name); auto* node = graph->RetrieveArgument(arg_name);
CHECK(node) << "argument " << arg_name << " not exists in the graph"; CHECK(node) << "argument " << arg_name << " not exists in the graph";
auto& arg_node = node->AsArgument(); auto& arg_node = node->AsArgument();
if (arg_node.place.is_valid()) continue; if (arg_node.type) continue;
UpdatePlace(&arg_node.place, type->tensor_place);
arg_node.type = type->type; arg_node.type = type->type;
} }
} }
...@@ -86,9 +85,8 @@ class VariablePlaceInferencePass : public DebugPass { ...@@ -86,9 +85,8 @@ class VariablePlaceInferencePass : public DebugPass {
auto* node = graph->RetrieveArgument(arg_name); auto* node = graph->RetrieveArgument(arg_name);
CHECK(node) << "argument " << arg_name << " not exists in the graph"; CHECK(node) << "argument " << arg_name << " not exists in the graph";
auto& arg_node = node->AsArgument(); auto& arg_node = node->AsArgument();
if (arg_node.place.is_valid()) continue; if (arg_node.type) continue;
node->AsArgument().type = type->type; node->AsArgument().type = type->type;
UpdatePlace(&arg_node.place, type->tensor_place);
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册