#NEWLINE# def shared( value , name = None , strict = False , allow_downcast = None , **kwargs ) : #NEWLINE# #INDENT# 'Return a SharedVariable Variable, initialized with a copy or\n    reference of `value`.\n\n    This function iterates over constructor functions to find a\n    suitable SharedVariable subclass.  The suitable one is the first\n    constructor that accept the given value.  See the documentation of\n    :func:`shared_constructor` for the definition of a contructor\n    function.\n\n    This function is meant as a convenient default.  If you want to use a\n    specific shared variable constructor, consider calling it directly.\n\n    ``theano.shared`` is a shortcut to this function.\n\n    .. attribute:: constructors\n\n    A list of shared variable constructors that will be tried in reverse\n    order.\n\n    Notes\n    -----\n    By passing kwargs, you effectively limit the set of potential constructors\n    to those that can accept those kwargs.\n\n    Some shared variable have ``borrow`` as extra kwargs.\n    `See <http://deeplearning.net/software/theano/tutorial/aliasing.    html#borrowing-when-creating-shared-variables>`_ for details.\n\n    Some shared variable have ``broadcastable`` as extra kwargs. As shared\n    variable shapes can change, all dimensions default to not being\n    broadcastable, even if ``value`` has a shape of 1 along some dimension.\n    This parameter allows you to create for example a `row` or `column` 2d\n    tensor.\n\n    ' #NEWLINE# try : #NEWLINE# #INDENT# if isinstance ( value , Variable ) : #NEWLINE# #INDENT# raise TypeError ( 'Shared variable constructor needs numeric values and not symbolic variables.' ) #NEWLINE# #UNINDENT# for ctor in reversed ( shared . constructors ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# var = ctor ( value , name = name , strict = strict , allow_downcast = allow_downcast , ** kwargs ) #NEWLINE# utils . add_tag_trace ( var ) #NEWLINE# return var #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except MemoryError as e : #NEWLINE# #INDENT# e . args = ( e . args + ( "you might consider using 'theano.shared(..., borrow=True)'" , ) ) #NEWLINE# raise #NEWLINE# #UNINDENT# raise TypeError ( ( 'No suitable SharedVariable constructor could be found. Are you sure all kwargs are supported? We do not support the parameter dtype or type. value="%s". parameters="%s"' % ( value , kwargs ) ) )