code: def linear_flop_jit(inputs: List[Any], outputs: List[Any]) -> Number:
      """
      Count flops for the aten::linear operator.
      """
      # Inputs is a list of length 3; unlike aten::addmm, it is the first
      # two elements that are relevant.
      input_shapes = [v.shape for v in inputs[0:2]]
      # input_shapes[0]: [dim0, dim1, ..., input_feature_dim]
      # input_shapes[1]: [output_feature_dim, input_feature_dim]
      assert input_shapes[0][-1] == input_shapes[1][-1]
      flops = reduce(operator.mul, input_shapes[0]) * input_shapes[1][0]
      return flops
  
file_path: colossalai/colossalai/fx/profiler/opcount.py
imports: import operator
  from functools import partial, reduce
  from numbers import Number
  from typing import Any, Callable, List
  import torch
  from packaging import version
label_desc: Use image node_id 3 for calling a global function with example usage: linear_flop_jit(inputs, outputs) and returns: flops