def random_binomial(shape, p=0.0, dtype=None, seed=None):
 if (dtype is None):
  dtype = floatx()
 if (seed is None):
  seed = np.random.randint(10000000.0)
 return tf.where((tf.random_uniform(shape, dtype=dtype, seed=seed) <= p), tf.ones(shape, dtype=dtype), tf.zeros(shape, dtype=dtype))

def random_binomial ( shape , p = 0.0 , dtype = None , seed = None ) : if ( dtype is None ) : dtype = floatx ( ) if ( seed is None ) : seed = np . random . randint ( 10000000.0 ) return tf . where ( ( tf . random_uniform ( shape , dtype = dtype , seed = seed ) <= p ) , tf . ones ( shape , dtype = dtype ) , tf . zeros ( shape , dtype = dtype ) )
returns a tensor with binomlai distribution # arguments shape: a tuple of integers .