File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -401,5 +401,23 @@ def test_median_dygraph(self):
401401 self .dygraph_single_test_median ([x , 1 , False ])
402402
403403
404+ class TestMedianSort (unittest .TestCase ):
405+ def dygraph_single_test_median (self , lis_test ):
406+ x , axis , keepdims = lis_test
407+ res_np = np .median (x , axis = axis , keepdims = keepdims )
408+ x_pd = paddle .to_tensor (x )
409+ x_pd .stop_gradient = False
410+ res_pd = paddle .median (x_pd , axis , keepdims )
411+ np .testing .assert_allclose (res_pd .numpy (), res_np )
412+
413+ def test_median_dygraph (self ):
414+ paddle .disable_static ()
415+ h = 2
416+ w = 20000
417+ l = 2
418+ x = np .arange (h * w * l ).reshape ([h , w , l ])
419+ self .dygraph_single_test_median ([x , 1 , False ])
420+
421+
404422if __name__ == '__main__' :
405423 unittest .main ()
You can’t perform that action at this time.
0 commit comments