We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5b2de50 + 01fdf17 commit 6d2deedCopy full SHA for 6d2deed
paddle/fluid/operators/elementwise_op.h
@@ -46,9 +46,11 @@ class ElementwiseOpInferVarType : public framework::VarTypeInference {
46
public:
47
void operator()(const framework::OpDesc& op_desc,
48
framework::BlockDesc* block) const override {
49
- auto x_var = op_desc.Input("X")[0];
50
- auto out_var = op_desc.Output("Out")[0];
51
- block->Var(out_var)->SetType(block->Var(x_var)->GetType());
+ auto x_name = op_desc.Input("X")[0];
+ auto out_name = op_desc.Output("Out")[0];
+ auto& x = block->FindRecursiveOrCreateVar(x_name);
52
+ auto& out = block->FindRecursiveOrCreateVar(out_name);
53
+ out.SetType(x.GetType());
54
}
55
};
56
0 commit comments