code: def test_measure_flops():
      with torch.device("meta"):
          model = BoringModel()
          x = torch.randn(2, 32)
      model_fwd = lambda: model(x)
      model_loss = lambda y: y.sum()
  
      fwd_flops = measure_flops(model, model_fwd)
      assert isinstance(fwd_flops, int)
  
      fwd_and_bwd_flops = measure_flops(model, model_fwd, model_loss)
      assert isinstance(fwd_and_bwd_flops, int)
      assert fwd_flops < fwd_and_bwd_flops
  
file_path: pytorch-lightning/tests/tests_fabric/utilities/test_throughput.py
imports: from unittest import mock
  from unittest.mock import Mock, call
  import pytest
  import torch
  from lightning.fabric import Fabric
  from lightning.fabric.plugins import Precision
  from lightning.fabric.utilities.throughput import Throughput, ThroughputMonitor, _MonotonicWindow, get_available_flops, measure_flops
  from tests_fabric.helpers.runif import RunIf
  from tests_fabric.test_fabric import BoringModel
label_desc: Use image node_id 1 for calling a global function with example usage: test_measure_flops() without return types