'Generate adversarial examples and return them as a NumPy array.
Sub-classes *should not* implement this method unless they must
perform special handling of arguments.
:param x_val: A NumPy array with the original inputs.
:param **kwargs: optional parameters used by child classes.
:return: A NumPy array holding the adversarial examples.'

def generate_np(self, x_val, **kwargs):

    if (self.back == 'th'):
        raise NotImplementedError('Theano    version    not    implemented.')
    if (self.sess is None):
        raise ValueError('Cannot    use    `generate_np`    when    no    `sess`    was    provided')
    fixed = dict(((k, v) for (k, v) in kwargs.items() if (k in self.structural_kwargs)))
    feedable = dict(((k, v) for (k, v) in kwargs.items() if (k in self.feedable_kwargs)))
    if ((len(fixed) + len(feedable)) < len(kwargs)):
        warnings.warn('Supplied    extra    keyword    arguments    that    are    not    used    in    the    graph    computation.    They    have    been    ignored.')
    if (not all((isinstance(value, collections.Hashable) for value in fixed.values()))):
        hash_key = None
    else:
        hash_key = tuple(sorted(fixed.items()))
    if (hash_key not in self.graphs):
        self.construct_graph(fixed, feedable, x_val, hash_key)
    (x, new_kwargs, x_adv) = self.graphs[hash_key]
    feed_dict = {x: x_val}
    for name in feedable:
        feed_dict[new_kwargs[name]] = feedable[name]
    return self.sess.run(x_adv, feed_dict)
