code: def tensor_constructor(
      value,
      name=None,
      strict=False,
      allow_downcast=None,
      borrow=False,
      shape=None,
      target="cpu",
      broadcastable=None,
  ):
      r"""`SharedVariable` constructor for `TensorType`\s.
  
      Notes
      -----
      The default is to assume that the `shape` value might be resized in any
      dimension, so the default shape is ``(None,) * len(value.shape)``.  The
      optional `shape` argument will override this default.
  
      """
      if isinstance(value, np.ma.MaskedArray):
          raise NotImplementedError("MaskedArrays are not supported")
  
      if broadcastable is not None:
          warnings.warn(
              "The `broadcastable` keyword is deprecated; use `shape`.",
              DeprecationWarning,
          )
          shape = broadcastable
  
      if target != "cpu":
          raise TypeError("not for cpu")
  
      # If no shape is given, then the default is to assume that the value might
      # be resized in any dimension in the future.
      if shape is None:
          shape = (None,) * value.ndim
  
      type = TensorType(value.dtype, shape=shape)
  
      return TensorSharedVariable(
          type=type,
          value=np.array(value, copy=(not borrow)),
          strict=strict,
          allow_downcast=allow_downcast,
          name=name,
      )
  
file_path: pytensor/pytensor/tensor/sharedvar.py
imports: import warnings
  import numpy
  from pytensor.compile import SharedVariable, shared_constructor
  from pytensor.misc.safe_asarray import _asarray
  from pytensor.tensor import _get_vector_length
  from pytensor.tensor.type import TensorType
  from pytensor.tensor.variable import _tensor_py_operators
label_desc: Use image node_id 3 for calling a global function with example usage: tensor_constructor(value, name, strict, allow_downcast, borrow, shape, target, broadcastable) and returns: TensorSharedVariable