@@ -1190,8 +1190,8 @@ def find_actual(target_name, fetch_list):
11901190 with _test_eager_guard ():
11911191 eager_imperative_actual = find_imperative_actual (
11921192 sub_out_name , eager_dygraph_outs , place )
1193- eager_imperative_actual_t = np . array (
1194- eager_imperative_actual . value (). get_tensor () )
1193+ eager_imperative_actual_t = eager_imperative_actual . numpy (
1194+ )
11951195
11961196 idx = find_actual (sub_out_name , fetch_list )
11971197 actual = outs [idx ]
@@ -1252,8 +1252,8 @@ def find_actual(target_name, fetch_list):
12521252 with _test_eager_guard ():
12531253 eager_imperative_actual = find_imperative_actual (
12541254 out_name , eager_dygraph_outs , place )
1255- eager_imperative_actual_t = np . array (
1256- eager_imperative_actual . value (). get_tensor () )
1255+ eager_imperative_actual_t = eager_imperative_actual . numpy (
1256+ )
12571257
12581258 idx = find_actual (out_name , fetch_list )
12591259 actual = outs [idx ]
@@ -1663,12 +1663,9 @@ def check_grad_with_place(self,
16631663 "Gradient Check On %s" % str (place ))
16641664
16651665 if check_dygraph :
1666- dygraph_inputs_to_check = copy (inputs_to_check )
1667- dygraph_user_defined_grad_outputs = copy (user_defined_grad_outputs )
1668-
16691666 dygraph_grad = self ._get_dygraph_grad (
1670- dygraph_inputs_to_check , place , output_names ,
1671- dygraph_user_defined_grad_outputs , no_grad_set )
1667+ inputs_to_check , place , output_names , user_defined_grad_outputs ,
1668+ no_grad_set )
16721669 fp32_grads = []
16731670 for grad in dygraph_grad :
16741671 if grad .dtype == np .uint16 :
@@ -1681,12 +1678,10 @@ def check_grad_with_place(self,
16811678 "Gradient Check On %s" % str (place ))
16821679
16831680 if check_eager :
1684- eager_inputs_to_check = copy (inputs_to_check )
1685- eager_user_defined_grad_outputs = copy (user_defined_grad_outputs )
16861681 with _test_eager_guard ():
16871682 eager_dygraph_grad = self ._get_dygraph_grad (
1688- eager_inputs_to_check , place , output_names ,
1689- eager_user_defined_grad_outputs , no_grad_set )
1683+ inputs_to_check , place , output_names ,
1684+ user_defined_grad_outputs , no_grad_set )
16901685 fp32_grads = []
16911686 for grad in eager_dygraph_grad :
16921687 if grad .dtype == np .uint16 :
0 commit comments