Fix Add None problem

Signed-off-by: zjun <zhangjun0@huawei.com>
This commit is contained in:
zjun 2021-09-06 16:37:51 +08:00
parent 00a5180c35
commit 27c114f692
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):
"""