MCPcopy
hub / github.com/dask/dask / test_pad

Function test_pad

dask/array/tests/test_creation.py:867–878  ·  view source on GitHub ↗
(shape, chunks, pad_width, mode, kwargs)

Source from the content-addressed store, hash-verified

865 ],
866)
867def test_pad(shape, chunks, pad_width, mode, kwargs):
868 np_a = np.random.random(shape)
869 da_a = da.from_array(np_a, chunks=chunks)
870
871 np_r = np.pad(np_a, pad_width, mode, **kwargs)
872 da_r = da.pad(da_a, pad_width, mode, **kwargs)
873
874 if mode == "empty":
875 # empty pads lead to undefined values which may be different
876 assert_eq(np_r[pad_width:-pad_width], da_r[pad_width:-pad_width])
877 else:
878 assert_eq(np_r, da_r)
879
880
881@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
randomMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…