code: def const_matrix(matrix, name="const_matrix", attrs=None):
      """convert a const numpy 2-dimensional matrix to tvm tensor
  
      Parameters
      ----------
      matrix: numpy.ndarray
          Const input array
      name: str, optional
          The name of output op
  
      Returns
      -------
      tensor: Tensor
          The created tensor
      """
      row, col = matrix.shape
      dtype = str(matrix.dtype)
      idxm = tvm.tir.indexmod
  
      def select_array(i, j):
          now = tvm.tir.const(0.0, dtype)
          for ii in range(row):
              for jj in range(col):
                  now = tvm.tir.Select(
                      tvm.tir.all(
                          idxm(i, row) == ii, idxm(j, col) == jj
                      ),
                      tvm.tir.const(matrix[ii][jj], dtype),
                      now,
                  )
          return now
  
      if attrs is None:
          attrs = {"const_matrix": True, "schedule_rule": "None"}
  
      return te.compute(
          matrix.shape, select_array, name=name, attrs=attrs
      )
  
imports: from __future__ import absolute_import
  from numbers import Integral
  import numpy
  import tvm
  from tvm import te
  from tvm.tir import Any, SizeVar, bijective_layout, layout
  from .None import cpp, tag
label_desc: Use image node_id 16 for calling a global function with example usage: const_matrix(matrix, name, attrs) and returns: te, now