Sample from a Normal distribution with inferred mu and std

def compute_samples(self):
        """ Sample from a Normal distribution with inferred mu and std """
        shape = [self.batch_size, self.eq_samples, self.iw_samples, self.num_latent]
        mu = tf.nn.sigmoid(self.mu)
        z = tf.select(tf.random_uniform(shape) - mu > 0, tf.ones(shape), tf.zeros(shape))
        return z