diff --git a/paddle/framework/backward.cc b/paddle/framework/backward.cc index c625c0caf7d9bc07d377c97789b640f8223a94e1..b850939040034e5aebc7fb4e4be99802ad64e9ad 100644 --- a/paddle/framework/backward.cc +++ b/paddle/framework/backward.cc @@ -161,7 +161,7 @@ static std::unique_ptr BackwardRecursive( insert_add_out = name; } if (output_idx != 0) { - insert_add_y = name + "@SHARED@" + std::to_string(output_idx); + insert_add_y = name + "@SHARED@" + std::to_string(output_idx-1); } insert_position.push_back( {dup_op.back(),