Complex op test (#29753)

* delete no need to calculate inputs in dygraph op_test

* delete no need to calculate inputs in dygraph op_test
revert-31562-mean
chentianyu03 4 years ago committed by GitHub
parent 096c048b45
commit b59b6d7ae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1544,6 +1544,10 @@ class OpTest(unittest.TestCase):
grad_outputs = []
for grad_out_value in user_defined_grad_outputs:
grad_outputs.append(paddle.to_tensor(grad_out_value))
# delete the inputs which no need to calculate grad
for no_grad_val in no_grad_set:
del (inputs[no_grad_val])
grad_inputs = paddle.grad(
outputs=fluid.layers.utils.flatten(outputs),
inputs=fluid.layers.utils.flatten(inputs),

Loading…
Cancel
Save