@application
    def emit(self, readouts):
        """
        Single step

        :param readouts: output of hidden layer [batch_size,get_dim('inputs')]
        """
        mean, sigma, corr, weight, penup = self.components(readouts)
        mix_dim = self.mix_dim  # get_dim('mix')
        batch_size = readouts.shape[0]

        nr = self.theano_rng.normal(
            size=(batch_size, mix_dim, 2),
            avg=0., std=1.) #, dtype=floatX)

        c = (1 - T.sqrt(corr**2-1))/(corr + self.epsilon)
        c = c.dimshuffle((0, 1, 'x'))  # same for x and y
        nr = nr + nr[:,:,::-1]*c  # x+c*y and y + c*x

        nr = nr / T.sqrt(1+c**2)
        nr = nr * sigma
        nr = nr + mean
        # If I dont do dtype=floatX in the next line I get an error
        weight = self.theano_rng.multinomial(pvals=weight, dtype=floatX)
        # an alternative is the following code:
        # right_boundry = T.cumsum(weight,axis=1)  # [...,1]
        # left_boundry = right_boundry - weight  # [0,...]
        # un0 = self.theano_rng.uniform(size=(batch_size,)).dimshuffle((0, 'x'))
        # weight = T.cast(left_boundry <= un0, floatX) * \
        #          T.cast(un0 < right_boundry, floatX)  # 1 only in one bin

        xy = nr * weight[:,:,None]  # [batch_size,mix_dim,2]

        xy = xy.sum(axis=1) # [batch_size,2]

        un = self.theano_rng.uniform(size=(batch_size, 1)) #, dtype=floatX)
        penup = T.cast(un < penup, floatX) # .astype(floatX)  # [batch_size,1]

        res = T.concatenate([xy, penup], axis=1)
        return res
dataset/ETHPy150Open udibr/sketch/sketch.py/SketchEmitter.emit/swapped operands of `-`