code: def tensor_constructor(
      value,
      name=None,
      strict=False,
      allow_downcast=None,
      borrow=False,
      broadcastable=None,
      target="cpu",
  ):
      """
      SharedVariable Constructor for TensorType.
  
      Notes
      -----
      Regarding the inference of the broadcastable pattern...
      The default is to assume that the value might be resized in any
      dimension, so the default broadcastable is ``(False,)*len(value.shape)``.
      The optional `broadcastable` argument will override this default.
  
      """
      if target != "cpu":
          raise TypeError("not for cpu")
  
      if not isinstance(value, np.ndarray):
          raise TypeError()
  
      # if no broadcastable is given, then the default is to assume that
      # the value might be resized in any dimension in the future.
      #
      if broadcastable is None:
          broadcastable = (False,) * len(value.shape)
      type = TensorType(value.dtype, broadcastable=broadcastable)
      return TensorSharedVariable(
          type=type,
          value=np.array(value, copy=(not borrow)),
          name=name,
          strict=strict,
          allow_downcast=allow_downcast,
      )
  
file_path: Theano/theano/tensor/sharedvar.py
imports: from __future__ import absolute_import, print_function, division
  import traceback
  import numpy
  from six import integer_types
  import theano.tensor.basic
  from theano.tensor.basic import TensorType, _tensor_py_operators
  from theano.compile import shared_constructor, SharedVariable
label_desc: Use image node_id 2 for calling a global function with example usage: tensor_constructor(value, name, strict, allow_downcast, borrow, broadcastable, target) and returns: TensorSharedVariable