import tensorflow as tf

            else:
                self.loss_d_rot = self.loss_d + self.weight_rotation_loss_d * self.real_pc_rot_loss
                self.loss_g_rot = self.loss_g + self.weight_rotation_loss_g * self.gen_out_rot_loss
            
            # Compute gradient penalty at interpolated points
            ndims = self.real_pc.get_shape().ndims #(1024, 3)
            alpha = tf.random_uniform(shape=[self.batch_size] + [1] * (ndims - 1), minval=0., maxval=1.)
            differences = self.generator_out - self.real_pc
            interpolates = self.real_pc + (alpha * differences)

            with tf.variable_scope('discriminator') as scope:
                gradients = tf.gradients(self.discriminator(interpolates, reuse=True, scope=scope, **disc_kwargs)[1], [interpolates])[0]

            # Reduce over all but the first dimension
            slopes = tf.sqrt(tf.reduce_sum(tf.square(gradients), reduction_indices=list(range(1, ndims))))
            gradient_penalty = tf.reduce_mean((slopes - 1.) ** 2)
            self.loss_d_rot += lam * gradient_penalty

            train_vars = tf.trainable_variables()
            d_params = [v for v in train_vars if v.name.startswith(name + '/discriminator/')]
