code: def count_conv_flops(input_shape, output_shape, attr):
      kernel = attr["kernel"][1:-1].split(",")
      kernel = [int(x) for x in kernel]
  
      # print('kernel', kernel)
      if is_no_bias(attr):
          ret = (
              (2 * input_shape[1] * kernel[0] * kernel[1] - 1)
              * output_shape[2]
              * output_shape[3]
              * output_shape[1]
          )
      else:
          ret = (
              2
              * input_shape[1]
              * kernel[0]
              * kernel[1]
              * output_shape[2]
              * output_shape[3]
              * output_shape[1]
          )
      num_group = 1
      if "num_group" in attr:
          num_group = int(attr["num_group"])
      ret /= num_group
      return int(ret)
  
file_path: insightface/recognition/arcface_mxnet/common/flops_counter.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import os
  import json
  import argparse
  import numpy
  import mxnet
label_desc: Use image node_id 3 for calling a global function with example usage: count_conv_flops(input_shape, output_shape, attr) and returns: int