code: def _generate_dequant_bmm_node_pattern(
      _dequant_per_channel_pattern,
      dtype=torch.float32,
      with_bias=False,
  ):
      # When activation of linear dim exceed 2 and not contiguous
      t_pattern = _generate_linear_t_pattern(
          _dequant_per_channel_pattern, dtype
      )
  
      assert dtype in [torch.float32, torch.bfloat16]
      dequant_bmm_pattern = CallFunction(
          aten.bmm.default,
          CallFunction(
              aten.expand.default,
              _may_generate_pattern_with_dtype_convert(
                  dequantize_per_tensor_activation_pattern,
                  KeywordArg("autocast_act_dtype"),
                  dtype == torch.bfloat16,
              ),
              KeywordArg("act_expand_size"),
          ),
          CallFunction(
              aten.expand.default,
              t_pattern,
              KeywordArg("wgt_expand_size"),
          ),
      )
  
      def _generate_pattern_with_output_add(
          _dequant_bmm_pattern, _with_bias
      ):
          if _with_bias:
              return CallFunction(
                  aten.add.Tensor,
                  _dequant_bmm_pattern,
                  KeywordArg("b"),
              )
          else:
              return _dequant_bmm_pattern
  
      return _generate_pattern_with_output_add(
          dequant_bmm_pattern, with_bias
      )
  
imports: import copy
  import functools
  import itertools
  import math
  import operator
  from typing import Any, Tuple
  import torch
  from torch._dynamo.utils import counters
  from torch.fx.experimental.symbolic_shapes import has_free_symbols
  from ..lowering import lowerings, require_channels_last
  from ..pattern_matcher import Arg, CallFunction, filter_nodes, KeywordArg, ListOf, Match
  from ..utils import pad_listlike
  from .freezing_patterns import register_freezing_graph_pattern
  from .post_grad import register_lowering_pattern
label_desc: Use image node_id 36 for calling a global function with example usage: _generate_dequant_bmm_node_pattern(_dequant_per_channel_pattern, dtype, with_bias) and returns: _generate_pattern_with_output_add, CallFunction, _dequant_bmm_pattern