(shape, chunks, pad_width, mode, kwargs)
| 865 | ], |
| 866 | ) |
| 867 | def 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( |