class documentation

class TestHalf: (source)

View In Hierarchy

Undocumented

Method setup_method Undocumented
Method test_half_array_interface Test that half is compatible with __array_interface__
Method test_half_coercion Test that half gets coerced properly with the other types
Method test_half_conversion_denormal_round_even Undocumented
Method test_half_conversion_from_string Undocumented
Method test_half_conversion_rounding Undocumented
Method test_half_conversion_to_string Undocumented
Method test_half_conversions Checks that all 16-bit values survive conversion to/from 32-bit and 64-bit float
Method test_half_correctness Take every finite float16, and check the casting functions with a manual conversion.
Method test_half_fpe Undocumented
Method test_half_funcs Test the various ArrFuncs
Method test_half_ordering Make sure comparisons are working right
Method test_half_rounding Checks that rounding when converting to half is correct
Method test_half_ufuncs Test the various ufuncs
Method test_half_values Confirms a small number of known half values
Method test_nans_infs Undocumented
Method test_spacing_nextafter Test np.spacing and np.nextafter
Instance Variable all_f16 Undocumented
Instance Variable all_f32 Undocumented
Instance Variable all_f64 Undocumented
Instance Variable finite_f16 Undocumented
Instance Variable finite_f32 Undocumented
Instance Variable finite_f64 Undocumented
Instance Variable nonan_f16 Undocumented
Instance Variable nonan_f32 Undocumented
Instance Variable nonan_f64 Undocumented
def setup_method(self): (source)

Undocumented

def test_half_array_interface(self): (source)

Test that half is compatible with __array_interface__

@np._no_nep50_warning()
def test_half_coercion(self, weak_promotion): (source)

Test that half gets coerced properly with the other types

@pytest.mark.parametrize(['float_t', 'uint_t', 'bits'], [(np.float32, np.uint32, 23), (np.float64, np.uint64, 52)])
def test_half_conversion_denormal_round_even(self, float_t, uint_t, bits): (source)

Undocumented

@pytest.mark.parametrize('string_dt', ['S', 'U'])
def test_half_conversion_from_string(self, string_dt): (source)

Undocumented

@pytest.mark.parametrize('offset', [None, 'up', 'down'])
@pytest.mark.parametrize('shift', [None, 'up', 'down'])
@pytest.mark.parametrize('float_t', [np.float32, np.float64])
@np._no_nep50_warning()
def test_half_conversion_rounding(self, float_t, shift, offset): (source)

Undocumented

@pytest.mark.parametrize('string_dt', ['S', 'U'])
def test_half_conversion_to_string(self, string_dt): (source)

Undocumented

def test_half_conversions(self): (source)

Checks that all 16-bit values survive conversion to/from 32-bit and 64-bit float

def test_half_correctness(self): (source)

Take every finite float16, and check the casting functions with a manual conversion.

@pytest.mark.skipif((platform.machine() == 'armv5tel'), reason='See gh-413.')
@pytest.mark.skipif(IS_WASM, reason='fp exceptions don\'t work in wasm.')
def test_half_fpe(self): (source)

Undocumented

def test_half_funcs(self): (source)

Test the various ArrFuncs

def test_half_ordering(self): (source)

Make sure comparisons are working right

def test_half_rounding(self): (source)

Checks that rounding when converting to half is correct

def test_half_ufuncs(self): (source)

Test the various ufuncs

def test_half_values(self): (source)

Confirms a small number of known half values

def test_nans_infs(self): (source)

Undocumented

def test_spacing_nextafter(self): (source)

Test np.spacing and np.nextafter

Undocumented

Undocumented

Undocumented

finite_f16 = (source)

Undocumented

finite_f32 = (source)

Undocumented

finite_f64 = (source)

Undocumented

nonan_f16 = (source)

Undocumented

nonan_f32 = (source)

Undocumented

nonan_f64 = (source)

Undocumented