code: def _get_linear_dq_mul_node(
      linear_node,
      input_index,
      dtype,
      input_dim_exceeds_two,
      input_contiguous,
  ):
      act_reshape_node = None
      activation_to_bf16_node = None
      act_expand_node = None
      if input_dim_exceeds_two:
          if input_contiguous:
              act_reshape_node = linear_node.args[input_index]
              assert act_reshape_node.target is aten.reshape.default
              if dtype == torch.float32:
                  # pattern: linear -> reshape -> mul
                  mul_node = act_reshape_node.args[0]
              else:
                  # pattern: linear -> reshape -> to_bf16 -> mul
                  activation_to_bf16_node = act_reshape_node.args[0]
                  mul_node = activation_to_bf16_node.args[0]
          else:
              # bmm pattern decomposed from linear when input dim exceeds 2 and not contiguous
              act_expand_node = linear_node.args[input_index]
              assert act_expand_node.target is aten.expand.default
              if dtype == torch.float32:
                  mul_node = act_expand_node.args[0]
              else:
                  activation_to_bf16_node = act_expand_node.args[0]
                  mul_node = activation_to_bf16_node.args[0]
      else:
          if dtype == torch.float32:
              # pattern: linear -> mul
              mul_node = linear_node.args[input_index]
          else:
              # pattern: linear -> to_bf16 -> mul
              activation_to_bf16_node = linear_node.args[input_index]
              mul_node = activation_to_bf16_node.args[0]
      return (
          mul_node,
          act_reshape_node,
          activation_to_bf16_node,
          act_expand_node,
      )
  
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 32 for calling a global function with example usage: _get_linear_dq_mul_node(linear_node, input_index, dtype, input_dim_exceeds_two, input_contiguous) and returns: mul_node,  act_reshape_node,  activation_to_bf16_node,  act_expand_node