code: def test_noparamgrad(ctxmgr):
      _run_one_assert_consistent(
          ctxmgr,
          mix_model,
          get_state_fn=get_param_grad_state,
          assert_inside=_assert_grad_off,
      )
  
      _run_one_assert_val(
          ctxmgr,
          gradon_model,
          assert_inside=_assert_grad_off,
          assert_outside=_assert_grad_on,
      )
  
      _run_one_assert_val(
          ctxmgr,
          gradoff_model,
          assert_inside=_assert_grad_off,
          assert_outside=_assert_grad_off,
      )
  
file_path: advertorch/tests/test_context.py
imports: import pytest
  from advertorch.context import ctx_eval
  from advertorch.context import ctx_noparamgrad
  from advertorch.context import ctx_noparamgrad_and_eval
  from advertorch.context import get_param_grad_state
  from advertorch.context import get_module_training_state
  from advertorch.context import set_param_grad_off
  from advertorch.utils import torch_allclose
  from advertorch.test_utils import SimpleModel
  from advertorch.test_utils import vecdata
label_desc: Use image node_id 8 for calling a global function with example usage: test_noparamgrad(ctxmgr) without return types