code: def log_model_info(model, cfg, use_train_input=True):
      """
      Log info, includes number of parameters, gpu usage, gflops and activation count.
          The model info is computed when the model is in validation mode.
      Args:
          model (model): model to log the info.
          cfg (CfgNode): configs. Details can be found in
              slowfast/config/defaults.py
          use_train_input (bool): if True, log info for training. Otherwise,
              log info for testing.
      """
      logger.info("Model:\n{}".format(model))
      params = params_count(model)
      logger.info("Params: {:,}".format(params))
      logger.info("Mem: {:,} MB".format(gpu_mem_usage()))
      flops = get_model_stats(model, cfg, "flop", use_train_input)
      logger.info("Flops: {:,} G".format(flops))
      logger.info(
          "Activations: {:,} M".format(
              get_model_stats(model, cfg, "activation", use_train_input)
          )
      )
      logger.info("nvidia-smi")
      os.system("nvidia-smi")
      return flops, params
  
imports: import json
  import logging
  import math
  import numpy
  import os
  from datetime import datetime
  import psutil
  import torch
  import torchvision.io
  from fvcore.nn.activation_count import activation_count
  from fvcore.nn.flop_count import flop_count
  from matplotlib import pyplot
  from torch import nn
  from torchvision.utils import make_grid
  import slowfast.utils.logging
  import slowfast.utils.multiprocessing
  from slowfast.datasets.utils import pack_pathway_output
  from slowfast.models.batchnorm_helper import SubBatchNorm3d
  from slowfast.utils.env import pathmgr
label_desc: Use image node_id 7 for calling a global function with example usage: log_model_info(model, cfg, use_train_input) and returns: flops,  params