File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
python/paddle/fluid/tests/unittests Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -295,20 +295,20 @@ class AffineChannelNoNeedBufferVarsInference
295
295
using framework::NoNeedBufferVarsInference::NoNeedBufferVarsInference;
296
296
297
297
private:
298
- inline bool HasInput (const std::string& name) const {
299
- auto & inputs = Inputs ();
300
- auto iter = inputs .find (name);
301
- if (iter == inputs .end () || iter->second .empty ()) {
298
+ inline bool HasOutput (const std::string& name) const {
299
+ auto & outputs = Outputs ();
300
+ auto iter = outputs .find (name);
301
+ if (iter == outputs .end () || iter->second .empty ()) {
302
302
return false ;
303
303
} else {
304
304
return iter->second [0 ] != framework::kEmptyVarName ;
305
305
}
306
306
}
307
307
308
308
public:
309
- std::unordered_set<std::string> operator ()() const {
310
- if (!HasInput (framework::GradVarName (" Scale" )) &&
311
- !HasInput (framework::GradVarName (" Bias" ))) {
309
+ std::unordered_set<std::string> operator ()() const override {
310
+ if (!HasOutput (framework::GradVarName (" Scale" )) &&
311
+ !HasOutput (framework::GradVarName (" Bias" ))) {
312
312
return {" X" };
313
313
} else {
314
314
return {};
Original file line number Diff line number Diff line change @@ -125,7 +125,8 @@ list(REMOVE_ITEM TEST_OPS test_basic_lstm_unit_op)
125
125
126
126
# Some ops need to check results when gc is enabled
127
127
# Currently, only ops that register NoNeedBufferVarsInference need to do this test
128
- set (TEST_OPS_WITH_GC
128
+ set (TEST_OPS_WITH_GC
129
+ test_affine_channel_op
129
130
test_concat_op
130
131
test_elementwise_add_op
131
132
test_elementwise_sub_op
You can’t perform that action at this time.
0 commit comments