def check_normal_basic(shape_as_symbolic, dim_as_symbolic=False):
 rng = CURAND_RandomStreams(234)
 if shape_as_symbolic:
  shape = constant((10, 10))
 elif dim_as_symbolic:
  shape = (10, constant(10))
 else:
  shape = (10, 10)
 u0 = rng.normal(shape)
 u1 = rng.normal(shape)
 f0 = theano.function([], u0, mode=mode_with_gpu)
 f1 = theano.function([], u1, mode=mode_with_gpu)
 v0list = [f0() for i in range(3)]
 v1list = [f1() for i in range(3)]
 assert numpy.all((v0list[0] != v0list[1]))
 assert numpy.all((v1list[0] != v1list[1]))
 assert numpy.all((v0list[0] != v1list[0]))
 for v in v0list:
  assert (v.shape == (10, 10))
  assert (v.min() < v.max())
  assert ((-0.5) <= v.mean() <= 0.5)

def check_normal_basic ( shape_as_symbolic , dim_as_symbolic = False ) : rng = CURAND_RandomStreams ( 234 ) if shape_as_symbolic : shape = constant ( ( 10 , 10 ) ) elif dim_as_symbolic : shape = ( 10 , constant ( 10 ) ) else : shape = ( 10 , 10 ) u0 = rng . normal ( shape ) u1 = rng . normal ( shape ) f0 = theano . function ( [ ] , u0 , mode = mode_with_gpu ) f1 = theano . function ( [ ] , u1 , mode = mode_with_gpu ) v0list = [ f0 ( ) for i in range ( 3 ) ] v1list = [ f1 ( ) for i in range ( 3 ) ] assert numpy . all ( ( v0list [ 0 ] != v0list [ 1 ] ) ) assert numpy . all ( ( v1list [ 0 ] != v1list [ 1 ] ) ) assert numpy . all ( ( v0list [ 0 ] != v1list [ 0 ] ) ) for v in v0list : assert ( v . shape == ( 10 , 10 ) ) assert ( v . min ( ) < v . max ( ) ) assert ( ( - 0.5 ) <= v . mean ( ) <= 0.5 )
check_normal_basic runs a basic sanity check on the normal method of a curand_randomstreams object .