forked from mindspore-Ecosystem/mindspore
Fix Add None problem
Signed-off-by: zjun <zhangjun0@huawei.com>
This commit is contained in:
parent
00a5180c35
commit
27c114f692
|
@ -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();
|
||||
|
|
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue