class_docstr: Auxiliary builder to build IR for testing and dev.
  
  Examples
  --------
  .. code-block:: python
  
      ib = tvm.tir.ir_builder.create()
      n = te.var("n")
      A = ib.allocate("float32", n, name="A")
      with ib.for_range(0, n, name="i") as i:
          with ib.if_scope((i % 2) == 0):
              A[i] = A[i] + 1
      # The result stmt.
      stmt = ib.get()
docstr: Create a for iteration scope.
  
  Parameters
  ----------
  begin : Expr
      The min iteration scope.
  
  end : Expr
      The end iteration scope
  
  name : str, optional
      The name of iteration variable, if no input names,
      using typical index names i, j, k, then i_nidx
  
  dtype : str, optional
      The data type of iteration variable.
  
  kind : str, optional
      The special tag on the for loop.
  
  Returns
  -------
  loop_scope : With.Scope of Var
      The for scope, when enters returns loop_var
  
  Examples
  --------
  .. code-block:: python
  
      ib = tvm.tir.ir_builder.create()
      x = ib.pointer("float32")
      with ib.for_range(1, 10, name="i") as i:
          x[i] = x[i - 1] + 1
code: def for_range(self, begin, end, name="i", dtype=None, kind="serial"):
      """Create a for iteration scope.
  
      Parameters
      ----------
      begin : Expr
          The min iteration scope.
  
      end : Expr
          The end iteration scope
  
      name : str, optional
          The name of iteration variable, if no input names,
          using typical index names i, j, k, then i_nidx
  
      dtype : str, optional
          The data type of iteration variable.
  
      kind : str, optional
          The special tag on the for loop.
  
      Returns
      -------
      loop_scope : With.Scope of Var
          The for scope, when enters returns loop_var
  
      Examples
      --------
      .. code-block:: python
  
          ib = tvm.tir.ir_builder.create()
          x = ib.pointer("float32")
          with ib.for_range(1, 10, name="i") as i:
              x[i] = x[i - 1] + 1
      """
      if name == "i":
          name = (
              chr(ord(name) + self.nidx)
              if self.nidx < 3
              else name + "_" + str(self.nidx - 3)
          )
          self.nidx += 1
      self._seq_stack.append([])
  
      # auto infer dtype when it's not specified
      def get_dtype(expr):
          if isinstance(expr, _expr.PrimExpr):
              if not expr.dtype.startswith("int"):
                  raise NotImplementedError(
                      f"Infer loop_var dtype failed:"
                      f" unsupported dtype in loop begin or end {expr.dtype}"
                  )
              return expr.dtype
          if isinstance(expr, int):
              return "int32"
          raise NotImplementedError(
              f"Infer loop_var dtype failed:"
              f" unsupported dtype in loop begin or end {expr.dtype}"
          )
  
      if dtype is None:
          dtype = (
              "int64"
              if "int64" in [get_dtype(begin), get_dtype(end)]
              else "int32"
          )
  
      loop_var = _expr.Var(name, dtype=dtype)
      extent = end if begin == 0 else (end - begin)
  
      def _exit_cb():
          if kind == "serial":
              kind_id = _stmt.ForKind.SERIAL
          elif kind == "parallel":
              kind_id = _stmt.ForKind.PARALLEL
          elif kind == "vectorize":
              kind_id = _stmt.ForKind.VECTORIZED
          elif kind == "unroll":
              kind_id = _stmt.ForKind.UNROLLED
          else:
              raise ValueError("Unknown kind")
          self.emit(
              _stmt.For(
                  loop_var, begin, extent, kind_id, self._pop_seq()
              )
          )
  
      return WithScope(loop_var, _exit_cb)
  
imports: import tvm
  from tvm._ffi.base import string_types
  from tvm.runtime import ObjectGeneric, convert, const
  from tvm.ir import container
  from .None import stmt
  from .None import expr
  from .None import buffer
  from .None import op
label_desc: Use image node_id 5 for calling the IRBuilder obj's underlying member method code with example usage: obj.for_range(begin, end, name, dtype, kind) and returns: WithScope, expr, str