code: def shared(value, name=None, strict=False, allow_downcast=None):
      """
      SharedVariable constructor for scalar values. Default: int64 or float64.
  
      Notes
      -----
      We implement this using 0-d tensors for now.
  
      """
      if not isinstance(
          value, (np.number, float, integer_types, complex)
      ):
          raise TypeError()
      try:
          dtype = value.dtype
      except AttributeError:
          dtype = np.asarray(value).dtype
  
      dtype = str(dtype)
      value = getattr(np, dtype)(value)
      scalar_type = Scalar(dtype=dtype)
      rval = ScalarSharedVariable(
          type=scalar_type,
          value=value,
          name=name,
          strict=strict,
          allow_downcast=allow_downcast,
      )
      return rval
  
file_path: Theano/theano/scalar/sharedvar.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  from six import integer_types
  from theano.compile import SharedVariable
  from .basic import Scalar, _scalar_py_operators
label_desc: Use image node_id 1 for calling a global function with example usage: shared(value, name, strict, allow_downcast) and returns: rval