MCPcopy Create free account
hub / github.com/numpy/numpy / test_f_signed_int_big_jump

Method test_f_signed_int_big_jump

numpy/lib/tests/test_function_base.py:1336–1341  ·  view source on GitHub ↗
(self, f_dtype)

Source from the content-addressed store, hash-verified

1334 @pytest.mark.parametrize('f_dtype', [np.int8, np.int16,
1335 np.int32, np.int64])
1336 def test_f_signed_int_big_jump(self, f_dtype):
1337 maxint = np.iinfo(f_dtype).max
1338 x = np.array([1, 3])
1339 f = np.array([-1, maxint], dtype=f_dtype)
1340 dfdx = gradient(f, x)
1341 assert_array_equal(dfdx, [(maxint + 1) // 2] * 2)
1342
1343 @pytest.mark.parametrize('x_dtype', [np.uint8, np.uint16,
1344 np.uint32, np.uint64])

Callers

nothing calls this directly

Calls 2

gradientFunction · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected