@@ -1139,14 +1139,12 @@ def check_einsum_sums(self, dtype, do_opt=False):
11391139 result = inp .einsum (* args , dtype = "?" , casting = "unsafe" , optimize = do_opt )
11401140 assert_dtype_allclose (result , expected )
11411141
1142- # with an scalar, NumPy < 2.0.0 uses the other input arrays to
1143- # determine the output type while for NumPy > 2.0.0 the scalar
1144- # with default machine dtype is used to determine the output
1145- # data type
1142+ # NumPy >= 2.0 follows NEP-50 to determine the output dtype when one of
1143+ # the inputs is a scalar while NumPy < 2.0 does not
11461144 if numpy .lib .NumpyVersion (numpy .__version__ ) < "2.0.0" :
1147- check_type = True
1148- else :
11491145 check_type = False
1146+ else :
1147+ check_type = True
11501148 a = numpy .arange (9 , dtype = dtype )
11511149 a_dp = inp .array (a )
11521150 expected = numpy .einsum (",i->" , 3 , a )
@@ -1712,7 +1710,7 @@ def test_broadcasting_dot_cases(self):
17121710
17131711 def test_output_order (self ):
17141712 # Ensure output order is respected for optimize cases, the below
1715- # conraction should yield a reshaped tensor view
1713+ # contraction should yield a reshaped tensor view
17161714 a = inp .ones ((2 , 3 , 5 ), order = "F" )
17171715 b = inp .ones ((4 , 3 ), order = "F" )
17181716
0 commit comments