def fgsm_attack(delta, epsilon, data_grad):
    """
    This function modifies a delta by epsilon * sign of data_grad
    Params:
        delta --> A torch.tensor of the adversarial patch
        epsilon --> The amount to modify delta (float)
        data_grad --> The current gradient direction (torch.tensor)

    Returns:
        perturbed_delta --> The new delta (torch.tensor)

    """



    # Collect the element-wise sign of the data gradient
    sign_data_grad = data_grad.sign()

    # Create the perturbed delta by adjusting each pixel of the input delta
    perturbed_delta = delta + epsilon*sign_data_grad

    # Return the perturbed delta
    return perturbed_delta