code: def get_ops(
      model: torch.nn.Module, weight: Weights, height=512, width=512
  ):
      module_name = model.__module__.split(".")[-2]
      dims = get_dims(
          module_name=module_name, height=height, width=width
      )
  
      input_tensor = torch.randn(dims)
  
      # try:
      preprocess = weight.transforms()
      if module_name == "optical_flow":
          inp = preprocess(input_tensor, input_tensor)
      else:
          # hack to enable mod(*inp) for optical_flow models
          inp = [preprocess(input_tensor)]
  
      model.eval()
  
      flop_counter = FlopCounterMode(model)
      with flop_counter:
          # detection models expect a list of 3d tensors as inputs
          if module_name == "detection":
              model(inp)
          else:
              model(*inp)
  
          flops = flop_counter.get_flops()
  
      return round(flops, 3)
  
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 14 for calling a global function with example usage: get_ops(model, weight, height, width) and returns: round