@@ -988,12 +988,15 @@ def check(dtype, N, M_=None, k=0):
988988 M = M_
989989 # Currently DebugMode does not support None as inputs even if this is
990990 # allowed.
991- if M is None and config .mode in ["DebugMode" , "DEBUG_MODE" ]:
991+ if M is None : # and config.mode in ["DebugMode", "DEBUG_MODE"]:
992992 M = N
993993 N_symb = iscalar ()
994- f = function ([N_symb ], tri (N_symb , M = M , k = k , dtype = dtype ))
995- # kwargs = {}
996- result = f (N )
994+ M_symb = iscalar ()
995+ k_symb = iscalar ()
996+ f = function (
997+ [N_symb , M_symb , k_symb ], tri (N_symb , M_symb , k_symb , dtype = dtype )
998+ )
999+ result = f (N , M , k )
9971000 assert np .allclose (result , np .tri (N , M_ , k , dtype = dtype ))
9981001 assert result .dtype == np .dtype (dtype )
9991002
@@ -1025,15 +1028,15 @@ def test_tril_triu(self):
10251028
10261029 def check_l (m , k = 0 ):
10271030 m_symb = matrix (dtype = m .dtype )
1028- # k_symb = iscalar()
1029- f = function ([m_symb ], tril (m_symb , k = k ))
1031+ k_symb = iscalar ()
1032+ f = function ([m_symb , k_symb ], tril (m_symb , k_symb ))
10301033 f_indx = function (
1031- [m_symb ], tril_indices (m_symb .shape [0 ], k = k , m = m_symb .shape [1 ])
1034+ [m_symb , k_symb ], tril_indices (m_symb .shape [0 ], k_symb , m_symb .shape [1 ])
10321035 )
1033- f_indx_from = function ([m_symb ], tril_indices_from (m_symb ))
1034- result = f (m )
1035- result_indx = f_indx (m , k = k )
1036- result_from = f_indx_from (m , k = k )
1036+ f_indx_from = function ([m_symb , k_symb ], tril_indices_from (m_symb , k_symb ))
1037+ result = f (m , k )
1038+ result_indx = f_indx (m , k )
1039+ result_from = f_indx_from (m , k )
10371040 assert np .allclose (result , np .tril (m , k ))
10381041 assert np .allclose (result_indx , np .tril_indices (m .shape [0 ], k , m .shape [1 ]))
10391042 assert np .allclose (result_from , np .tril_indices_from (m , k ))
@@ -1043,7 +1046,7 @@ def check_l(m, k=0):
10431046 def check_u (m , k = 0 ):
10441047 m_symb = matrix (dtype = m .dtype )
10451048 k_symb = iscalar ()
1046- f = function ([m_symb , k_symb ], triu (m_symb , k = k ))
1049+ f = function ([m_symb , k_symb ], triu (m_symb , k_symb ))
10471050 f_indx = function (
10481051 [m_symb , k_symb ], triu_indices (m_symb .shape [0 ], k_symb , m_symb .shape [1 ])
10491052 )
@@ -1075,7 +1078,7 @@ def check_u_batch(m):
10751078 assert np .allclose (result , np .triu (m , k ))
10761079 assert result .dtype == np .dtype (dtype )
10771080
1078- for dtype in ["int32" , "int64" , "float32" , "float64" , "uint16" , "complex64" ]:
1081+ for dtype in ["int32" , "int64" , "float32" , "float64" , "uint16" ]:
10791082 m = random_of_dtype ((10 , 10 ), dtype )
10801083 check_l (m , 0 )
10811084 check_l (m , 1 )
0 commit comments