Skip to content

Commit

Permalink
remove import of slim for flatten layer
Browse files Browse the repository at this point in the history
  • Loading branch information
npapernot committed Aug 17, 2017
1 parent 7ccf5ba commit b98dec8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cleverhans/utils_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import os
import six
import tensorflow as tf
import tensorflow.contrib.slim as slim
import time
import warnings
import logging
Expand Down Expand Up @@ -383,7 +382,7 @@ def l2_batch_normalize(x, epsilon=1e-12, scope=None):
"""
with tf.name_scope(scope, "l2_batch_normalize") as scope:
x_shape = tf.shape(x)
x = slim.flatten(x)
x = tf.contrib.layers.flatten(x)
x /= (epsilon + tf.reduce_max(tf.abs(x), 1, keep_dims=True))
square_sum = tf.reduce_sum(tf.square(x), 1, keep_dims=True)
x_inv_norm = tf.rsqrt(np.sqrt(epsilon) + square_sum)
Expand Down

0 comments on commit b98dec8

Please sign in to comment.