docstr: Test the app_state method
docstr_tok: ["Test","the","app_state","method"]
code: def test_app_state(self) -> None:
      """
      Test the app_state method
      """
  
      my_unit = Dummy()
  
      # the attributes should be in app_state
      for key in (
          "module_a",
          "loss_fn_b",
          "optimizer_c",
          "lr_scheduler_d",
          "grad_scaler_e",
      ):
          self.assertTrue(key in my_unit.app_state())
  
      # delete the attributes
      # pyre-fixme[8]: Attribute has type `Linear`; used as `None`.
      my_unit.module_a = None
      # pyre-fixme[8]: Attribute has type `CrossEntropyLoss`; used as `None`.
      my_unit.loss_fn_b = None
      # pyre-fixme[8]: Attribute has type `SGD`; used as `None`.
      my_unit.optimizer_c = None
      # pyre-fixme[8]: Attribute has type `StepLR`; used as `None`.
      my_unit.lr_scheduler_d = None
      # pyre-fixme[8]: Attribute has type `GradScaler`; used as `None`.
      my_unit.grad_scaler_e = None
  
      # the attributes should no longer be in app_state
      for key in (
          "module_a",
          "loss_fn_b",
          "optimizer_c",
          "lr_scheduler_d",
          "grad_scaler_e",
      ):
          self.assertFalse(key in my_unit.app_state())
  
imports: import unittest
  from typing import Any, Dict
  from unittest.mock import patch
  import torch
  from torch import nn
  from torchtnt.framework._test_utils import DummyAutoUnit
  from torchtnt.framework.unit import AppStateMixin
  from torchtnt.utils.env import init_from_env
  from torchtnt.utils.lr_scheduler import TLRScheduler
  from torchtnt.utils.prepare_module import FSDPOptimizerWrapper
label_desc: Use image node_id 5 for calling the AppStateMixinTest obj's underlying member method code with example usage: obj.test_app_state() without return types