docstr: Test garbage collection is enabled after runs are finished (with fit entry point)
docstr_tok: ["Test","garbage","collection","is","enabled","after","runs","are","finished","(","with","fit","entry","point",")"]
code: def test_garbage_collector_enabled_fit(self) -> None:
      """
      Test garbage collection is enabled after runs are finished (with fit entry point)
      """
      input_dim = 2
      train_dataset_len = 10
      eval_dataset_len = 6
      batch_size = 2
      max_epochs = 2
      evaluate_every_n_epochs = 1
  
      my_unit = DummyFitUnit(2)
      gc_callback = GarbageCollector(2)
  
      train_dataloader = generate_random_dataloader(
          train_dataset_len, input_dim, batch_size
      )
      eval_dataloader = generate_random_dataloader(
          eval_dataset_len, input_dim, batch_size
      )
  
      self.assertTrue(gc.isenabled())
      fit(
          my_unit,
          train_dataloader=train_dataloader,
          eval_dataloader=eval_dataloader,
          max_epochs=max_epochs,
          evaluate_every_n_epochs=evaluate_every_n_epochs,
          callbacks=[gc_callback],
      )
      self.assertTrue(gc.isenabled())
  
imports: import gc
  import unittest
  from unittest import mock
  from unittest.mock import MagicMock
  from torchtnt.framework._test_utils import DummyEvalUnit, DummyFitUnit, DummyPredictUnit, DummyTrainUnit, generate_random_dataloader
  from torchtnt.framework.callbacks.garbage_collector import GarbageCollector
  from torchtnt.framework.evaluate import evaluate
  from torchtnt.framework.fit import fit
  from torchtnt.framework.predict import predict
  from torchtnt.framework.train import train
label_desc: Use image node_id 8 for calling the GarbageCollectorTest obj's underlying member method code with example usage: obj.test_garbage_collector_enabled_fit() without return types