@shared_constructor
def scalar_constructor(value, name=None, strict=False, allow_downcast=None, borrow=False, target='cpu'):
 if (target != 'cpu'):
  raise TypeError('not for cpu')
 if (not isinstance(value, (numpy.number, float, integer_types, complex))):
  raise TypeError()
 try:
  dtype = value.dtype
 except Exception:
  dtype = numpy.asarray(value).dtype
 dtype = str(dtype)
 value = theano._asarray(value, dtype=dtype)
 tensor_type = TensorType(dtype=str(value.dtype), broadcastable=[])
 try:
  rval = ScalarSharedVariable(type=tensor_type, value=numpy.array(value, copy=True), name=name, strict=strict, allow_downcast=allow_downcast)
  return rval
 except Exception:
  traceback.print_exc()
  raise

@ shared_constructor def scalar_constructor ( value , name = None , strict = False , allow_downcast = None , borrow = False , target = 'cpu' ) : if ( target != 'cpu' ) : raise TypeError ( 'not for cpu' ) if ( not isinstance ( value , ( numpy . number , float , integer_types , complex ) ) ) : raise TypeError ( ) try : dtype = value . dtype except Exception : dtype = numpy . asarray ( value ) . dtype dtype = str ( dtype ) value = theano . _asarray ( value , dtype = dtype ) tensor_type = TensorType ( dtype = str ( value . dtype ) , broadcastable = [ ] ) try : rval = ScalarSharedVariable ( type = tensor_type , value = numpy . array ( value , copy = True ) , name = name , strict = strict , allow_downcast = allow_downcast ) return rval except Exception : traceback . print_exc ( ) raise
sharedvariable constructor for scalar values .