code: def dense_pack(cfg, data, weight, bias=None, out_dtype=None):
      """Compute dense with transformed weight."""
      if out_dtype is None:
          out_dtype = data.dtype
      M, K = get_const_tuple(data.shape)  # batch, in_dim
      if len(weight.shape) == 3:
          N, _, packw_bn = get_const_tuple(weight.shape)  # out_dim
          N = N * packw_bn
      else:
          N, _ = get_const_tuple(weight.shape)  # out_dim
      # create tuning space
      cfg.define_split(
          "tile_y",
          32 if isinstance(M, (tvm.tir.Var, tvm.tir.Any)) else M,
          num_outputs=3,
      )
      cfg.define_split(
          "tile_x",
          32 if isinstance(N, (tvm.tir.Var, tvm.tir.Any)) else N,
          num_outputs=3,
      )
      cfg.define_split(
          "tile_k",
          32 if isinstance(K, (tvm.tir.Var, tvm.tir.Any)) else K,
          num_outputs=2,
      )
      cfg.define_split(
          "tile_inner",
          32 if isinstance(M, (tvm.tir.Var, tvm.tir.Any)) else M,
          num_outputs=2,
          filter=lambda y: y.size[-1] <= 16,
      )
      if cfg.is_fallback:
          _default_dense_pack_config(cfg, M, N, K)
  
      if len(weight.shape) == 2:
          packw_bn = cfg["tile_x"].size[-1]
          packw_shape = (N // packw_bn, K, packw_bn)
          if autotvm.GLOBAL_SCOPE.in_tuning:
              # Directly use modified data layout placeholder.
              packw = tvm.te.placeholder(
                  packw_shape, weight.dtype, name="packed_weight"
              )
          else:
              packw = te.compute(
                  packw_shape,
                  lambda z, y, x: weight[z * packw_bn + x, y],
                  name="packed_weight",
              )
      else:
          packw = weight
  
      idxdiv = tvm.tir.indexdiv
      idxmod = tvm.tir.indexmod
      k = te.reduce_axis((0, K), name="k")
      C = te.compute(
          (M, N),
          lambda y, x: te.sum(
              data[y, k].astype(out_dtype)
              * packw[
                  idxdiv(x, packw_bn), k, idxmod(x, packw_bn)
              ].astype(out_dtype),
              axis=k,
          ),
          tag="dense_pack",
      )
      if bias is not None:
          C = te.compute(
              (M, N),
              lambda i, j: C[i, j] + bias[j].astype(out_dtype),
              tag=tag.BROADCAST,
          )
      return C
  
imports: from __future__ import absolute_import
  import tvm
  from tvm import autotvm, te
  from tvm.autotvm.task.space import SplitEntity
  from tvm.contrib import cblas, dnnl, mkl
  from tvm.target.x86 import get_simd_32bit_lanes
  from tvm.target.codegen import target_has_features
  from ..None import generic, tag
  from ..utils import get_const_tuple, traverse_inline
  from .tensor_intrin import acc_32x32_int32_sapphirerapids, dot_16x1x16_uint8_int8_int32, dot_32x128x32_u8s8s32_sapphirerapids
label_desc: Use image node_id 7 for calling a global function with example usage: dense_pack(cfg, data, weight, bias, out_dtype) and returns: C