def cuda_shared_constructor(value, name=None, strict=False, allow_downcast=None, borrow=False, broadcastable=None, target='gpu'):
 if (target != 'gpu'):
  raise TypeError('not for gpu')
 if strict:
  _value = value
 else:
  _value = theano._asarray(value, dtype='float32')
 if (not isinstance(_value, numpy.ndarray)):
  raise TypeError('ndarray required')
 if (_value.dtype.num != CudaNdarrayType.typenum):
  raise TypeError('float32 ndarray required')
 if (broadcastable is None):
  broadcastable = ((False,) * len(value.shape))
 type = CudaNdarrayType(broadcastable=broadcastable)
 print('trying to return?')
 try:
  rval = CudaNdarraySharedVariable(type=type, value=_value, name=name, strict=strict)
 except Exception as e:
  print('ERROR', e)
  raise
 return rval

def cuda_shared_constructor ( value , name = None , strict = False , allow_downcast = None , borrow = False , broadcastable = None , target = 'gpu' ) : if ( target != 'gpu' ) : raise TypeError ( 'not for gpu' ) if strict : _value = value else : _value = theano . _asarray ( value , dtype = 'float32' ) if ( not isinstance ( _value , numpy . ndarray ) ) : raise TypeError ( 'ndarray required' ) if ( _value . dtype . num != CudaNdarrayType . typenum ) : raise TypeError ( 'float32 ndarray required' ) if ( broadcastable is None ) : broadcastable = ( ( False , ) * len ( value . shape ) ) type = CudaNdarrayType ( broadcastable = broadcastable ) print ( 'trying to return?' ) try : rval = CudaNdarraySharedVariable ( type = type , value = _value , name = name , strict = strict ) except Exception as e : print ( 'ERROR' , e ) raise return rval
sharedvariable constructor for cudandarraytype .