@@ -22,7 +22,7 @@ def test_ewise_injective():
2222 x_np = np .random .uniform (size = dshape ).astype (dtype )
2323 m .run (x = x_np )
2424 out = m .get_output (0 , tvm .nd .empty ((10 , 6 )))
25- np .testing .assert_allclose (
25+ tvm .testing .assert_allclose (
2626 out .asnumpy (), x_np .reshape (out .shape ) * 2 + 1 ,
2727 atol = 1e-5 , rtol = 1e-5 )
2828
@@ -54,7 +54,7 @@ def test_conv_ewise_injective():
5454 data .asnumpy (), kernel .asnumpy (), (1 ,1 ), 'SAME' )
5555 c_np = c_np + bias .asnumpy ().reshape (kshape [0 ], 1 , 1 ) + 1
5656 c_np = c_np .reshape (c_np .shape [0 ], np .prod (c_np .shape [1 :])) + 1
57- np .testing .assert_allclose (out .asnumpy (), c_np , rtol = 1e-5 )
57+ tvm .testing .assert_allclose (out .asnumpy (), c_np , rtol = 1e-5 )
5858
5959
6060def test_injective_reduce_injective ():
@@ -74,7 +74,7 @@ def test_injective_reduce_injective():
7474 c_np = np .sum (data .reshape (32 , 18 * 18 ) + 1 , axis = 1 )
7575 # get output
7676 out = m .get_output (0 , tvm .nd .empty (c_np .shape , dtype ))
77- np .testing .assert_allclose (out .asnumpy (), c_np , rtol = 1e-5 )
77+ tvm .testing .assert_allclose (out .asnumpy (), c_np , rtol = 1e-5 )
7878
7979
8080def test_injective_conv2d ():
@@ -107,7 +107,7 @@ def test_injective_conv2d():
107107 data .asnumpy (), kernel .asnumpy (), (1 ,1 ), 'SAME' )
108108 weight = np .mean (data .asnumpy (), axis = (2 , 3 ))
109109 c_np = weight [:, :, np .newaxis , np .newaxis ] * data .asnumpy () + residual
110- np .testing .assert_allclose (out .asnumpy (), c_np , rtol = 1e-5 )
110+ tvm .testing .assert_allclose (out .asnumpy (), c_np , rtol = 1e-5 )
111111
112112
113113def test_concatenate_conv2d ():
@@ -140,7 +140,7 @@ def test_concatenate_conv2d():
140140 conv = topi .testing .conv2d_nchw_python (
141141 concat , kernel .asnumpy (), (1 ,1 ), 'SAME' )
142142 ref = concat + conv
143- np .testing .assert_allclose (out .asnumpy (), ref , rtol = 1e-5 )
143+ tvm .testing .assert_allclose (out .asnumpy (), ref , rtol = 1e-5 )
144144
145145
146146def test_residual_block_layout_transform ():
@@ -178,7 +178,7 @@ def test_residual_block_layout_transform():
178178 conv2 = topi .testing .conv2d_nchw_python (
179179 conv1 , kernel2 .asnumpy (), (1 ,1 ), 'SAME' )
180180 ref = np .maximum (conv1 + conv2 , 0 )
181- np .testing .assert_allclose (out .asnumpy (), ref , rtol = 1e-5 )
181+ tvm .testing .assert_allclose (out .asnumpy (), ref , rtol = 1e-5 )
182182
183183
184184def build_and_run (sym , params , data , out_shape , target , ctx , opt_level = 2 ):
@@ -218,7 +218,7 @@ def get_sym(out_channel):
218218 _ , params2 = utils .create_workload (sym2 , 1 , dshape [1 :], seed = 0 )
219219 output1 , g1 = build_and_run (sym1 , params1 , data , oshape , target , ctx , opt_level = 2 )
220220 output2 , g2 = build_and_run (sym2 , params2 , data , oshape , target , ctx , opt_level = 0 )
221- np .testing .assert_allclose (output1 , output2 , rtol = 1e-5 , atol = 1e-5 )
221+ tvm .testing .assert_allclose (output1 , output2 , rtol = 1e-5 , atol = 1e-5 )
222222 # data, conv weight, bias, batch norm gamma, batch norm beta, conv op
223223 assert g1 .index .num_nodes == 6
224224
0 commit comments