MCPcopy Index your code
hub / github.com/numpy/numpy / _create_arrays_all

Method _create_arrays_all

numpy/_core/tests/test_half.py:21–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

19
20class TestHalf:
21 def _create_arrays_all(self):
22 # An array of all possible float16 values
23 all_f16 = np.arange(0x10000, dtype=uint16)
24 all_f16 = all_f16.view(float16)
25
26 # NaN value can cause an invalid FP exception if HW is being used
27 with np.errstate(invalid='ignore'):
28 all_f32 = np.array(all_f16, dtype=float32)
29 all_f64 = np.array(all_f16, dtype=float64)
30 return all_f16, all_f32, all_f64
31
32 def _create_arrays_nonan(self):
33 # An array of all non-NaN float16 values, in sorted order

Callers 2

test_half_conversionsMethod · 0.95
test_nans_infsMethod · 0.95

Calls 1

viewMethod · 0.45

Tested by

no test coverage detected