import torch


def get_saliency(interpreter, inputs, target):
    """ Perform integrated gradient for saliency.
    """
    # define saliency interpreter
    # interpreter = captum.attr.Saliency(net)
    attribution = interpreter.attribute(inputs, target)
    attribution = torch.squeeze(attribution)
    return torch.sum(attribution, 0)