@@ -1918,23 +1918,28 @@ def test_basic(self, xp: ModuleType):
19181918 ],
19191919 dtype = xp .float64 ,
19201920 )
1921- xp_assert_close (angle (x ), expected , rtol = 0 , atol = 1e-11 )
1922- xp_assert_close (angle (x , deg = True ), expected * 180 / xp .pi , rtol = 0 , atol = 1e-11 )
1921+ xp_assert_close (angle (x , xp = xp ), expected , rtol = 0 , atol = 1e-11 )
1922+ xp_assert_close (
1923+ angle (x , deg = True , xp = xp ),
1924+ expected * 180 / xp .pi ,
1925+ rtol = 0 ,
1926+ atol = 1e-11 ,
1927+ )
19231928
19241929 def test_real (self , xp : ModuleType ):
19251930 x = xp .asarray ([0.0 , - 0.0 , 1.0 , - 1.0 ])
19261931 expected = xp .asarray ([0.0 , xp .pi , 0.0 , xp .pi ], dtype = x .dtype )
1927- xp_assert_close (angle (x ), expected )
1932+ xp_assert_close (angle (x , xp = xp ), expected )
19281933
19291934 def test_complex (self , xp : ModuleType ):
19301935 a = xp .asarray ([1 + 1j , 1 - 1j , - 1 + 1j , - 1 - 1j ])
19311936 expected = xp .asarray ([xp .pi / 4 , - xp .pi / 4 , 3 * xp .pi / 4 , - 3 * xp .pi / 4 ])
1932- res = angle (a )
1937+ res = angle (a , xp = xp )
19331938 xp_assert_equal (res , expected )
19341939
19351940 def test_integral (self , xp : ModuleType ):
19361941 x = xp .asarray ([0 , - 1 , 1 ], dtype = xp .int32 )
1937- actual = angle (x )
1942+ actual = angle (x , xp = xp )
19381943 expected = xp .asarray (
19391944 [0.0 , xp .pi , 0.0 ], dtype = default_dtype (xp , device = get_device (x ))
19401945 )
@@ -1945,7 +1950,7 @@ def test_2d(self, xp: ModuleType):
19451950 expected = xp .asarray (
19461951 [[xp .pi / 4 , - xp .pi / 4 ], [3 * xp .pi / 4 , - 3 * xp .pi / 4 ]]
19471952 )
1948- res = angle (a )
1953+ res = angle (a , xp = xp )
19491954 xp_assert_equal (res , expected )
19501955
19511956 @pytest .mark .skip_xp_backend (Backend .TORCH , reason = "materialize 'meta' device" )
0 commit comments