@@ -175,14 +175,15 @@ def test_cholesky(self, array, dtype):
175175 )
176176 @pytest .mark .parametrize ("dtype" , get_all_dtypes (no_bool = True ))
177177 def test_cholesky_upper (self , array , dtype ):
178- ia = dpnp .array (array , dtype = dtype )
178+ a = numpy .array (array , dtype = dtype )
179+ ia = dpnp .array (a )
179180 result = dpnp .linalg .cholesky (ia , upper = True )
180181
181- if ia .ndim > 2 :
182+ if a .ndim > 2 :
182183 n = ia .shape [- 1 ]
183- ia_reshaped = ia .reshape (- 1 , n , n )
184+ a_reshaped = a .reshape (- 1 , n , n )
184185 res_reshaped = result .reshape (- 1 , n , n )
185- batch_size = ia_reshaped .shape [0 ]
186+ batch_size = a_reshaped .shape [0 ]
186187 for idx in range (batch_size ):
187188 # Reconstruct the matrix using the Cholesky decomposition result
188189 if dpnp .issubdtype (dtype , dpnp .complexfloating ):
@@ -192,15 +193,15 @@ def test_cholesky_upper(self, array, dtype):
192193 else :
193194 reconstructed = res_reshaped [idx ].T @ res_reshaped [idx ]
194195 assert_dtype_allclose (
195- reconstructed , ia_reshaped [idx ], check_type = False
196+ reconstructed , a_reshaped [idx ], check_type = False
196197 )
197198 else :
198199 # Reconstruct the matrix using the Cholesky decomposition result
199200 if dpnp .issubdtype (dtype , dpnp .complexfloating ):
200201 reconstructed = result .T .conj () @ result
201202 else :
202203 reconstructed = result .T @ result
203- assert_dtype_allclose (reconstructed , ia , check_type = False )
204+ assert_dtype_allclose (reconstructed , a , check_type = False )
204205
205206 # upper parameter support will be added in numpy 2.0 version
206207 @testing .with_requires ("numpy>=2.0" )
0 commit comments