code: def profile_fvcore(
      model,
      input_size=(3, 224, 224),
      batch_size=1,
      detailed=False,
      force_cpu=False,
  ):
      if force_cpu:
          model = model.to("cpu")
      device, dtype = (
          next(model.parameters()).device,
          next(model.parameters()).dtype,
      )
      example_input = torch.ones(
          (batch_size,) + input_size, device=device, dtype=dtype
      )
      fca = FlopCountAnalysis(model, example_input)
      aca = ActivationCountAnalysis(model, example_input)
      if detailed:
          fcs = flop_count_str(fca)
          print(fcs)
      return fca.total(), aca.total()
  
imports: import argparse
  import csv
  import json
  import logging
  import time
  from collections import OrderedDict
  from contextlib import suppress
  from functools import partial
  import torch
  import torch.nn
  import torch.nn.parallel
  from timm.data import resolve_data_config
  from timm.layers import set_fast_norm
  from timm.models import create_model, is_model, list_models
  from timm.optim import create_optimizer_v2
  from timm.utils import setup_default_logging, set_jit_fuser, decay_batch_step, check_batch_size_retry, ParseKwargs, reparameterize_model
label_desc: Use image node_id 6 for calling a global function with example usage: profile_fvcore(model, input_size, batch_size, detailed, force_cpu) and returns: fca,  aca