!22964 Fix add none

Merge pull request !22964 from zjun/fix_add_none
This commit is contained in:
i-robot 2021-09-07 12:46:00 +00:00 committed by Gitee
commit f6763eeb38
2 changed files with 16 additions and 0 deletions

View File

@ -2962,6 +2962,7 @@ void GradExecutor::ClearGrad(const py::object &cell, const py::args &args) {
if (grad_order_ > 0) {
--grad_order_;
}
check_graph_cell_id_.clear();
forward()->node_abs_map().clear();
ad::CleanRes();
pipeline::ReclaimOptimizer();

View File

@ -227,6 +227,21 @@ def add_rowtensor_tensor(x, y):
return F.row_tensor_add(x, y)
@add.register("None", "None")
def _none_add_none(x, y):
"""
Adds None and None.
Args:
x (None): x
y (None): y
Returns:
None.
"""
return None
@_add_backward.register("EnvType", "EnvType")
def _add_env(x, y):
"""