@@ -36,8 +36,8 @@ def setUp(self):
3636 self .init_data ()
3737 self .inputs = {'X' : self .x }
3838 self .attrs = {'hermitian' : self .hermitian }
39- if self .tolTensor is not None :
40- self .inputs ["TolTensor" ] = self .tolTensor
39+ if self .tol_tensor is not None :
40+ self .inputs ["TolTensor" ] = self .tol_tensor
4141 if self .tol is not None :
4242 self .attrs ["tol" ] = self .tol
4343 self .attrs ["use_default_tol" ] = self .use_default_tol
@@ -48,7 +48,7 @@ def test_check_output(self):
4848
4949 def init_data (self ):
5050 self .x = np .eye (3 , dtype = np .float32 )
51- self .tolTensor = None
51+ self .tol_tensor = None
5252 self .tol = 0.1
5353 self .use_default_tol = False
5454 self .hermitian = True
@@ -58,51 +58,56 @@ def init_data(self):
5858class TestMatrixRankOP1 (TestMatrixRankOP ):
5959 def init_data (self ):
6060 self .x = np .eye (3 , k = 1 , dtype = np .float64 )
61- self .tolTensor = None
61+ self .tol_tensor = None
6262 self .tol = None
6363 self .use_default_tol = True
6464 self .hermitian = False
65- self .out = np .linalg .matrix_rank (self .x , self .tolTensor , self .hermitian )
65+ self .out = np .linalg .matrix_rank (self .x , self .tol_tensor ,
66+ self .hermitian )
6667
6768
6869class TestMatrixRankOP2 (TestMatrixRankOP ):
6970 def init_data (self ):
7071 self .x = np .random .rand (3 , 4 , 5 , 6 ).astype (np .float32 )
71- self .tolTensor = np .random .random ([3 , 4 ]).astype (self .x .dtype )
72+ self .tol_tensor = np .random .random ([3 , 4 ]).astype (self .x .dtype )
7273 self .tol = None
7374 self .use_default_tol = False
7475 self .hermitian = False
75- self .out = np .linalg .matrix_rank (self .x , self .tolTensor , self .hermitian )
76+ self .out = np .linalg .matrix_rank (self .x , self .tol_tensor ,
77+ self .hermitian )
7678
7779
7880class TestMatrixRankOP3 (TestMatrixRankOP ):
7981 def init_data (self ):
8082 self .x = np .eye (200 , dtype = np .float64 )
81- self .tolTensor = None
83+ self .tol_tensor = None
8284 self .tol = None
8385 self .use_default_tol = True
8486 self .hermitian = True
85- self .out = np .linalg .matrix_rank (self .x , self .tolTensor , self .hermitian )
87+ self .out = np .linalg .matrix_rank (self .x , self .tol_tensor ,
88+ self .hermitian )
8689
8790
8891class TestMatrixRankOP4 (TestMatrixRankOP ):
8992 def init_data (self ):
9093 self .x = np .random .rand (1 , 10 ).astype (np .float32 )
91- self .tolTensor = None
94+ self .tol_tensor = None
9295 self .tol = None
9396 self .use_default_tol = True
9497 self .hermitian = False
95- self .out = np .linalg .matrix_rank (self .x , self .tolTensor , self .hermitian )
98+ self .out = np .linalg .matrix_rank (self .x , self .tol_tensor ,
99+ self .hermitian )
96100
97101
98102class TestMatrixRankOP5 (TestMatrixRankOP ):
99103 def init_data (self ):
100104 self .x = np .random .rand (5 , 1 ).astype (np .float64 )
101- self .tolTensor = np .random .random ([1 , 4 ]).astype (self .x .dtype )
105+ self .tol_tensor = np .random .random ([1 , 4 ]).astype (self .x .dtype )
102106 self .tol = None
103107 self .use_default_tol = False
104108 self .hermitian = False
105- self .out = np .linalg .matrix_rank (self .x , self .tolTensor , self .hermitian )
109+ self .out = np .linalg .matrix_rank (self .x , self .tol_tensor ,
110+ self .hermitian )
106111
107112
108113class TestMatrixRankAPI (unittest .TestCase ):
0 commit comments