code: def is_linear_module(module):
      in_features = None
      out_features = None
      mp_group = None
  
      is_awq = is_auto_awq_available() and isinstance(
          module, WQLinear_GEMM
      )
  
      if is_auto_gptq_available() and isinstance(
          module, QuantLinearCudaOld
      ):
          in_features = module.infeatures
          out_features = module.outfeatures
          mp_group = None
          result = True
      elif isinstance(module, nn.Linear) or is_awq:
          in_features = module.in_features
          out_features = module.out_features
          mp_group = None
          result = True
      else:
          if is_deepspeed_available():
              from deepspeed.module_inject.layers import (
                  LinearLayer,
                  LinearAllreduce,
              )
  
              if isinstance(module, LinearLayer):
                  in_features = module.weight.shape[1]
                  out_features = module.weight.shape[0]
                  mp_group = None
                  result = True
              elif isinstance(module, LinearAllreduce):
                  in_features = module.weight.shape[1]
                  out_features = module.weight.shape[0]
                  mp_group = module.mp_group
                  result = True
              else:
                  result = False
          else:
              result = False
  
      return result, (in_features, out_features, mp_group)
  
imports: import platform
  import torch
  import torch.nn
  from accelerate import init_empty_weights
  import warnings
  import transformers
  import importlib.util
  from bigdl.llm.ggml.quantize import ggml_tensor_qtype
  from .utils import logger
  from typing import Union
  import numpy
  import os
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 4 for calling a global function with example usage: is_linear_module(module) and returns: result,  in_features,  out_features,  mp_group