@@ -88,7 +88,7 @@ def test_fe5m2_to_float32_paper(self):
8888self .assertEqual (fe5m2_to_float32 (int ("11111100" ,2 )),- numpy .inf )
8989
9090def test_fe4m3fn_to_float32_all (self ):
91- for i in range (0 , 256 ):
91+ for i in range (256 ):
9292a = fe4m3_to_float32_float (i )
9393b = fe4m3_to_float32 (i )
9494if numpy .isnan (a ):
@@ -97,7 +97,7 @@ def test_fe4m3fn_to_float32_all(self):
9797self .assertEqual (a ,b )
9898
9999def test_fe4m3fn_to_float32_all_ml_types (self ):
100- for i in range (0 , 256 ):
100+ for i in range (256 ):
101101a = fe4m3_to_float32_float (i )
102102b = fe4m3_to_float32 (i )
103103c = new_cvt_float32_to_e4m3fn (b )
@@ -188,7 +188,7 @@ def test_search_float32_into_fe5m2_simple(self):
188188self .assertEqual (b1 ,b2 )
189189
190190def test_search_float32_into_fe4m3fn_equal (self ):
191- values = [(fe4m3_to_float32_float (i ),i )for i in range (0 , 256 )]
191+ values = [(fe4m3_to_float32_float (i ),i )for i in range (256 )]
192192values .sort ()
193193
194194for value ,expected in values :
@@ -208,7 +208,7 @@ def test_search_float32_into_fe4m3fn_equal(self):
208208self .assertIn (nf , (0 ,128 ))
209209
210210def test_search_float32_into_fe5m2_equal (self ):
211- values = [(fe5m2_to_float32_float (i ),i )for i in range (0 , 256 )]
211+ values = [(fe5m2_to_float32_float (i ),i )for i in range (256 )]
212212values .sort ()
213213
214214for value ,expected in values :
@@ -233,7 +233,7 @@ def test_search_float32_into_fe5m2_equal(self):
233233self .assertEqual (fe5m2_to_float32 (nf ),float (cf ))
234234
235235def test_search_float32_into_fe4m3fn (self ):
236- values = [(fe4m3_to_float32_float (i ),i )for i in range (0 , 256 )]
236+ values = [(fe4m3_to_float32_float (i ),i )for i in range (256 )]
237237values .sort ()
238238
239239obs = []
@@ -308,7 +308,7 @@ def test_search_float32_into_fe4m3fn(self):
308308 )
309309
310310def test_search_float32_into_fe5m2 (self ):
311- values = [(fe5m2_to_float32_float (i ),i )for i in range (0 , 256 )]
311+ values = [(fe5m2_to_float32_float (i ),i )for i in range (256 )]
312312values .sort ()
313313
314314obs = []
@@ -651,7 +651,7 @@ def test_search_float32_into_fe5m2fnuz_simple(self):
651651self .assertEqual (expected ,got )
652652
653653def test_fe4m3fnuz_to_float32_all (self ):
654- for i in range (0 , 256 ):
654+ for i in range (256 ):
655655a = fe4m3_to_float32_float (i ,uz = True )
656656b = fe4m3_to_float32 (i ,uz = True )
657657if numpy .isnan (a ):
@@ -660,7 +660,7 @@ def test_fe4m3fnuz_to_float32_all(self):
660660self .assertEqual (a ,b )
661661
662662def test_fe5m2fnuz_to_float32_all (self ):
663- for i in range (0 , 256 ):
663+ for i in range (256 ):
664664a = fe5m2_to_float32_float (i ,fn = True ,uz = True )
665665b = fe5m2_to_float32 (i ,fn = True ,uz = True )
666666if numpy .isnan (a ):
@@ -669,7 +669,7 @@ def test_fe5m2fnuz_to_float32_all(self):
669669self .assertEqual (a ,b )
670670
671671def test_search_float32_into_fe4m3fnuz (self ):
672- values = [(fe4m3_to_float32_float (i ,uz = True ),i )for i in range (0 , 256 )]
672+ values = [(fe4m3_to_float32_float (i ,uz = True ),i )for i in range (256 )]
673673values .sort ()
674674
675675obs = []
@@ -715,9 +715,7 @@ def test_search_float32_into_fe4m3fnuz(self):
715715 )
716716
717717def test_search_float32_into_fe5m2fnuz (self ):
718- values = [
719- (fe5m2_to_float32_float (i ,fn = True ,uz = True ),i )for i in range (0 ,256 )
720- ]
718+ values = [(fe5m2_to_float32_float (i ,fn = True ,uz = True ),i )for i in range (256 )]
721719values .sort ()
722720
723721obs = []
@@ -1235,7 +1233,7 @@ def test_nan(self):
12351233expected ,
12361234 )
12371235 ]
1238- for i in range (0 , 23 ):
1236+ for i in range (23 ):
12391237v = 0x7F800000 | (1 << i )
12401238f = numpy .uint32 (v ).view (numpy .float32 )
12411239values .append ((i ,v ,f ,expected ))