def METHOD_NAME(self, x: NDArray) -> NDArray:
    ncp = get_array_module(x)
    y = ncp.zeros(x.shape, self.dtype)
    y[..., :-2] += x[..., 1:-1]
    y[..., 1:-1] -= 2 * x[..., 1:-1]
    y[..., 2:] += x[..., 1:-1]
    if self.edge:
        y[..., 0] += x[..., 0]
        y[..., 1] -= 2 * x[..., 0]
        y[..., 2] += x[..., 0]
        y[..., -3] += x[..., -1]
        y[..., -2] -= 2 * x[..., -1]
        y[..., -1] += x[..., -1]
    y /= self.sampling**2
    return y