code: def dense_strategy_cpu(attrs, inputs, out_type, target):
      """dense x86 strategy"""
  
      strategy = _op.OpStrategy()
      # For dynamic matrix-vector multiply we use a hand written kernel.
      if (
          isinstance(inputs[0].shape[0], (int, tir.IntImm))
          and inputs[0].shape[0] == 1
          and (
              topi.utils.is_dynamic_shape(inputs[0].shape)
              or topi.utils.is_dynamic_shape(inputs[1].shape)
          )
      ):
          strategy.add_implementation(
              wrap_compute_dense(topi.x86.dense_dynamic),
              wrap_topi_schedule(topi.x86.schedule_dense_dynamic),
              name="dense_dynamic.x86",
              plevel=20,
          )
          return strategy
  
      same_type = inputs[0].dtype == inputs[1].dtype == out_type.dtype
      dtype = inputs[0].dtype
      u8s8s32 = (
          dtype == "uint8"
          and inputs[1].dtype == "int8"
          and out_type.dtype == "int32"
      )
      strategy.add_implementation(
          wrap_compute_dense(topi.x86.dense_nopack),
          wrap_topi_schedule(topi.x86.schedule_dense_nopack),
          name="dense_nopack.x86",
          plevel=5,
      )
  
      strategy.add_implementation(
          wrap_compute_dense(topi.x86.dense_pack),
          wrap_topi_schedule(topi.x86.schedule_dense_pack),
          name="dense_pack.x86",
          plevel=10,
      )
  
      need_auto_scheduler_layout = is_auto_scheduler_enabled()
      need_meta_schedule_layout = is_meta_schedule_enabled()
  
      if need_auto_scheduler_layout or need_meta_schedule_layout:
          strategy.add_implementation(
              wrap_compute_dense(
                  topi.nn.dense,
                  need_auto_scheduler_layout=need_auto_scheduler_layout,
                  need_meta_schedule_layout=need_meta_schedule_layout,
              ),
              naive_schedule,
              name="dense.generic",
              plevel=11,
          )
  
      if "cblas" in target.libs:
          with SpecializedCondition(
              same_type and dtype in ["float32", "float64"]
          ):
              strategy.add_implementation(
                  wrap_compute_dense(topi.x86.dense_cblas),
                  wrap_topi_schedule(topi.x86.schedule_dense_cblas),
                  name="dense_cblas.x86",
                  plevel=13,
              )
      if "mkl" in target.libs:
          with SpecializedCondition(
              same_type and dtype in ["float32", "float64"] or u8s8s32
          ):
              strategy.add_implementation(
                  wrap_compute_dense(topi.x86.dense_mkl),
                  wrap_topi_schedule(topi.x86.schedule_dense_mkl),
                  name="dense_mkl.x86",
                  plevel=14,
              )
      if "dnnl" in target.libs:
          with SpecializedCondition(same_type and dtype == "float32"):
              strategy.add_implementation(
                  wrap_compute_dense(topi.x86.dense_dnnl),
                  wrap_topi_schedule(topi.x86.schedule_dense_dnnl),
                  name="dense_dnnl.x86",
                  plevel=15,
              )
      return strategy
  
imports: import logging
  import re
  from tvm import tir, topi
  from tvm.auto_scheduler import is_auto_scheduler_enabled
  from tvm.meta_schedule import is_meta_schedule_enabled
  from tvm.relay.ty import is_dynamic
  from tvm.te import SpecializedCondition
  from ..None import op
  from .generic import *
label_desc: Use image node_id 16 for calling a global function with example usage: dense_strategy_cpu(attrs, inputs, out_type, target) and returns: strategy, strategy