This PR closes (structural problems in SPSA)
@@ -122,6 +122,12 @@ class Attack(object):
for name, value in feedable.items():
given_type = value.dtype
if isinstance(value, np.ndarray):
+ if value.ndim == 0:
+ # This is pretty clearly not a batch of data
+ new_kwargs[name] = tf.placeholder(given_type, shape=[], name=name)
+ else:
+ # Assume that this is a batch of data, make the first axis variable
+ # in size
new_shape = [None] + list(value.shape[1:])
new_kwargs[name] = tf.placeholder(given_type, new_shape, name=name)
elif isinstance(value, utils.known_number_types):
