def bernoulli_samples(p):
 rng_factory = MRG_RandomStreams(42)
 return rng_factory.binomial(p=p, size=p.shape, dtype=p.dtype, n=1)

def bernoulli_samples ( p ) : rng_factory = MRG_RandomStreams ( 42 ) return rng_factory . binomial ( p = p , size = p . shape , dtype = p . dtype , n = 1 )
p: a theano tensor with elements in the interval [0 .