Skip to content

Commit 8364688

Browse files
committed
Fix py_func_op's problem
1 parent b40e41f commit 8364688

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

paddle/fluid/operators/controlflow/get_places_op.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ execution.
9393

9494
class GetPlacesInferVarType : public framework::VarTypeInference {
9595
public:
96-
void operator()(framework::InferVarTypeContext &ctx) const override {
97-
for (auto &o_name : ctx.Output("Out")) {
98-
ctx.SetType(o_name, framework::proto::VarType::PLACE_LIST);
96+
void operator()(framework::InferVarTypeContext *ctx) const override {
97+
for (auto &o_name : ctx->Output("Out")) {
98+
ctx->SetType(o_name, framework::proto::VarType::PLACE_LIST);
9999
}
100100
}
101101
};

paddle/fluid/operators/py_func_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class PyFuncOpVarTypeInference : public framework::VarTypeInference {
9999
void operator()(framework::InferVarTypeContext *ctx) const override {
100100
bool has_out = (ctx->HasOutput("Out") && !ctx->Output("Out").empty());
101101

102-
bool has_in = (ctx->HasInput("X") && !ctx->Input("Out").empty());
102+
bool has_in = (ctx->HasInput("X") && !ctx->Input("X").empty());
103103

104104
/**
105105
* X or Out can be empty, so that py_func can be more flexible

0 commit comments

Comments
 (0)