import tensorflow as tf

        logging.info("DropconnectDenseLayer %s: %d %s" % (name, n_units, act.__name__))

        if W_init_args is None:
            W_init_args = {}
        if b_init_args is None:
            b_init_args = {}

        self.inputs = prev_layer.outputs

        if self.inputs.get_shape().ndims != 2:
            raise Exception("The input dimension must be rank 2")
        n_in = int(self.inputs.get_shape()[-1])
        self.n_units = n_units

        with tf.variable_scope(name):
            W = tf.get_variable(name='W', shape=(n_in, n_units), initializer=W_init, dtype=LayersConfig.tf_dtype, **W_init_args)
            b = tf.get_variable(name='b', shape=(n_units), initializer=b_init, dtype=LayersConfig.tf_dtype, **b_init_args)
            # self.outputs = act(tf.matmul(self.inputs, W) + b)

            LayersConfig.set_keep[name] = tf.placeholder(tf.float32)
            W_dropcon = tf.nn.dropout(W, LayersConfig.set_keep[name])
            self.outputs = act(tf.matmul(self.inputs, W_dropcon) + b)

        # self.all_layers = list(layer.all_layers)
        # self.all_params = list(layer.all_params)
        # self.all_drop = dict(layer.all_drop)
        self.all_drop.update({LayersConfig.set_keep[name]: keep})
        self.all_layers.append(self.outputs)
        self.all_params.extend([W, b])
