code: def matmul_flop(inputs: List[Any], outputs: List[Any]) -> Number:
      """
      Count flops for matmul.
      """
      # Inputs should be a list of length 2.
      # Inputs contains the shapes of two matrices.
      input_shapes = [get_shape(v) for v in inputs]
      assert len(input_shapes) == 2, input_shapes
      assert input_shapes[0][-1] == input_shapes[1][-2], input_shapes
      flop = prod(input_shapes[0]) * input_shapes[-1][-1]
      return flop
  
imports: import os
  from collections import defaultdict
  from numbers import Number
  from typing import Any, List
  import torch
  from torch.utils._python_dispatch import TorchDispatchMode
  from torch.utils._pytree import tree_map
  from torchvision.models._api import Weights
label_desc: Use image node_id 3 for calling a global function with example usage: matmul_flop(inputs, outputs) and returns: flop