Get the gradients of the image.

    Parameters:
    ----------
    net: Block
        Network to use for visualization.
    image: NDArray
        Preprocessed image to use for visualization.
    class_id: int
        Category ID this image belongs to. If not provided,
        network's prediction will be used.

def get_image_grad(net, image, class_id=None):
    """Get the gradients of the image.

    Parameters:
    ----------
    net: Block
        Network to use for visualization.
    image: NDArray
        Preprocessed image to use for visualization.
    class_id: int
        Category ID this image belongs to. If not provided,
        network's prediction will be used."""
    return _get_grad(net, image, class_id, image_grad=True)