code: def _allocate_tensor(func_id, args):
      """Handling TVM tensor allocation.
      You may refer hybrid.intrin.allocate for more details."""
      n = args.__len__()
      _internal_assert(
          isinstance(convert(args[0]), Array),
          "allocate's first argument should be a tuple of shape!",
      )
      shape = args[0]
      for i in shape:
          _internal_assert(
              isinstance(i, _expr.PrimExpr),
              "The shape should be an expression",
          )
      if n > 1:
          _internal_assert(
              isinstance(args[1], str), "The data type should be an str"
          )
          _internal_assert(
              args[1].startswith("int") or args[1].startswith("float"),
              "The data type should be either int or float!",
          )
          dtype = args[1]
      else:
          dtype = "float32"
      if n > 2:
          _internal_assert(
              isinstance(args[2], str),
              "The data scope should be an string",
          )
          _internal_assert(
              func_id != "output_tensor",
              "Output tensor cannot specify scope",
          )
          scope = args[2]
      else:
          scope = "global" if func_id != "output_tensor" else "output"
      return (shape, dtype, scope)
  
file_path: tvm/python/tvm/te/hybrid/calls.py
imports: from tvm.runtime import const, convert
  import tvm.te
  from tvm.ir.container import Array
  from tvm.target import Target
  from tvm.tir import expr
  from tvm.tir import call_intrin
  from tvm.tir.stmt import ForKind
  from .utils import _internal_assert
label_desc: Use image node_id 5 for calling a global function with example usage: _allocate_tensor(func_id, args) and returns: shape,  dtype,  scope