'Generate symbolic graph for adversarial examples and return.
:param x: The model\'s symbolic inputs.
:param eps: (optional float) attack step size (input variation)
:param ord: (optional) Order of the norm (mimics NumPy).
Possible values: np.inf, 1 or 2.
:param y: (optional) A tensor with the model labels. Only provide
this parameter if you\'d like to use true labels when crafting
adversarial samples. Otherwise, model predictions are used as
labels to avoid the "label leaking" effect (explained in this
paper: https://arxiv.org/abs/1611.01236). Default is None.
Labels should be one-hot-encoded.
:param y_target: (optional) A tensor with the labels to target. Leave
y_target=None if y is also set. Labels should be
one-hot-encoded.
:param clip_min: (optional float) Minimum input component value
:param clip_max: (optional float) Maximum input component value'

def generate(self, x, **kwargs):

    assert self.parse_params(**kwargs)
    if (self.back == 'tf'):
        from .attacks_tf import fgm
    else:
        from .attacks_th import fgm
    if (self.y is not None):
        y = self.y
    else:
        y = self.y_target
    return fgm(x, self.model.get_probs(x), y=y, eps=self.eps, ord=self.ord, clip_min=self.clip_min, clip_max=self.clip_max, targeted=(self.y_target is not None))
