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

Method test_x_decreasing_unsigned

numpy/lib/tests/test_function_base.py:1204–1208  ·  view source on GitHub ↗
(self, x_dtype)

Source from the content-addressed store, hash-verified

1202 @pytest.mark.parametrize('x_dtype', [np.uint8, np.uint16,
1203 np.uint32, np.uint64])
1204 def test_x_decreasing_unsigned(self, x_dtype):
1205 x = np.array([3, 2, 1], dtype=x_dtype)
1206 f = np.array([0, 2, 4])
1207 dfdx = gradient(f, x)
1208 assert_array_equal(dfdx, [-2]*len(x))
1209
1210 @pytest.mark.parametrize('x_dtype', [np.int8, np.int16,
1211 np.int32, np.int64])

Callers

nothing calls this directly

Calls 2

gradientFunction · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected