|
|
|
@ -121,9 +121,7 @@ class TestMKLDNNReluPrimitivesAlreadyExist(unittest.TestCase):
|
|
|
|
|
block = program.global_block()
|
|
|
|
|
for name in ground_truth:
|
|
|
|
|
block.create_var(
|
|
|
|
|
name=name,
|
|
|
|
|
dtype='float32',
|
|
|
|
|
shape=ground_truth[name].shape)
|
|
|
|
|
name=name, dtype='float32', shape=ground_truth[name].shape)
|
|
|
|
|
|
|
|
|
|
relu_op = block.append_op(
|
|
|
|
|
type="abs",
|
|
|
|
@ -149,8 +147,10 @@ class TestMKLDNNReluPrimitivesAlreadyExist(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
# Do at least 2 iterations
|
|
|
|
|
for i in range(2):
|
|
|
|
|
out = exe.run(program,
|
|
|
|
|
feed={name: var_dict[name] for name in ['x', 'out@GRAD']},
|
|
|
|
|
out = exe.run(
|
|
|
|
|
program,
|
|
|
|
|
feed={name: var_dict[name]
|
|
|
|
|
for name in ['x', 'out@GRAD']},
|
|
|
|
|
fetch_list=['x@GRAD'])
|
|
|
|
|
|
|
|
|
|
self.__assert_close(x_grad, out[0], "x@GRAD")
|
|
|
|
|