|
|
|
@ -281,7 +281,8 @@ class OpTest(unittest.TestCase):
|
|
|
|
|
type(sub_out))
|
|
|
|
|
for sub_out_name, expect in sub_out:
|
|
|
|
|
idx = find_actual(sub_out_name, fetch_list)
|
|
|
|
|
actual_t = np.array(outs[idx])
|
|
|
|
|
actual = outs[idx]
|
|
|
|
|
actual_t = np.array(actual)
|
|
|
|
|
expect_t = expect[0] \
|
|
|
|
|
if isinstance(expect, tuple) else expect
|
|
|
|
|
self.assertTrue(
|
|
|
|
@ -291,11 +292,12 @@ class OpTest(unittest.TestCase):
|
|
|
|
|
str(place))
|
|
|
|
|
if isinstance(expect, tuple):
|
|
|
|
|
self.assertListEqual(
|
|
|
|
|
actual_t.lod(), expect[1], "Output (" + sub_out_name
|
|
|
|
|
+ ") has different lod at " + str(place))
|
|
|
|
|
actual.lod(), expect[1], "Output (" + sub_out_name +
|
|
|
|
|
") has different lod at " + str(place))
|
|
|
|
|
else:
|
|
|
|
|
idx = find_actual(out_name, fetch_list)
|
|
|
|
|
actual_t = outs[idx]
|
|
|
|
|
actual = outs[idx]
|
|
|
|
|
actual_t = np.array(actual)
|
|
|
|
|
expect = self.outputs[out_name]
|
|
|
|
|
expect_t = expect[0] if isinstance(expect, tuple) else expect
|
|
|
|
|
self.assertTrue(
|
|
|
|
@ -303,7 +305,7 @@ class OpTest(unittest.TestCase):
|
|
|
|
|
actual_t, expect_t, atol=atol),
|
|
|
|
|
"Output (" + out_name + ") has diff at " + str(place))
|
|
|
|
|
if isinstance(expect, tuple):
|
|
|
|
|
self.assertListEqual(actual_t.lod(), expect[1],
|
|
|
|
|
self.assertListEqual(actual.lod(), expect[1],
|
|
|
|
|
"Output (" + out_name +
|
|
|
|
|
") has different lod at " + str(place))
|
|
|
|
|
|
|
|
|
|