retrieve default session if none is provided
@@ -33,7 +33,8 @@ class Attack(object):
if back == 'th' and sess is not None:
raise Exception("A session should not be provided when using th.")
elif back == 'tf' and sess is None:
- raise ValueError("A session should be provided when using tf.")
+ warnings.warn("A session should be provided when using tf.")
+ sess = tf.get_default_session()
if not isinstance(model, Model):
if hasattr(model, '__call__'):
