diff --git a/paddle/fluid/lite/core/mir/node.h b/paddle/fluid/lite/core/mir/node.h index a37c16b62d9f64af194e4e72d14211aa2111bbed..e16e6ffb7b3a24eef18876d7280da4772a7fb129 100644 --- a/paddle/fluid/lite/core/mir/node.h +++ b/paddle/fluid/lite/core/mir/node.h @@ -57,7 +57,6 @@ class Node { struct Argument { std::string name; - Place place; const Type* type; // Weight is a special kind of argument, it is marked as weight explicitly // so that some weight related optimization can take place. diff --git a/paddle/fluid/lite/core/mir/variable_place_inference_pass.h b/paddle/fluid/lite/core/mir/variable_place_inference_pass.h index 25285025354e79a7a7b027754ccd563b0652e048..3a05828d53c1eedcf127cd320d467de10ef8d951 100644 --- a/paddle/fluid/lite/core/mir/variable_place_inference_pass.h +++ b/paddle/fluid/lite/core/mir/variable_place_inference_pass.h @@ -38,8 +38,8 @@ class VariablePlaceInferencePass : public DebugPass { continue; } - auto& arg = v->AsArgument(); - arg.place.target = argument_default_target_; + // auto& arg = v->AsArgument(); + // arg.place.target = argument_default_target_; // the other place description can't be determined yet, until their first // usage by some kernel. } @@ -66,8 +66,7 @@ class VariablePlaceInferencePass : public DebugPass { auto* node = graph->RetrieveArgument(arg_name); CHECK(node) << "argument " << arg_name << " not exists in the graph"; auto& arg_node = node->AsArgument(); - if (arg_node.place.is_valid()) continue; - UpdatePlace(&arg_node.place, type->tensor_place); + if (arg_node.type) continue; arg_node.type = type->type; } } @@ -86,9 +85,8 @@ class VariablePlaceInferencePass : public DebugPass { auto* node = graph->RetrieveArgument(arg_name); CHECK(node) << "argument " << arg_name << " not exists in the graph"; auto& arg_node = node->AsArgument(); - if (arg_node.place.is_valid()) continue; + if (arg_node.type) continue; node->AsArgument().type = type->type; - UpdatePlace(&arg_node.place, type->tensor_place); } } }