class_docstr: This class takes `Pytorch's test_optim function:
  https://github.com/pytorch/pytorch/blob/v1.9.0/test/test_optim.py for reference.
class_docstr_tok: ["This","class","takes","`","Pytorch","'s","test_optim","function",":","https",":","\/\/github.com\/pytorch\/pytorch\/blob\/v1.9.0\/test\/test_optim.py","for","reference","."]
code: def test_step(
      self, specify_param, default_param, weight, bias, input
  ):
      optimizer = Novograd(specify_param, **default_param)
  
      def fn():
          optimizer.zero_grad()
          y = weight.mv(input)
          if (
              y.is_cuda
              and bias.is_cuda
              and y.get_device() != bias.get_device()
          ):
              y = y.cuda(bias.get_device())
          loss = (y + bias).pow(2).sum()
          loss.backward()
          return loss
  
      initial_value = fn().item()
      for _ in range(100):
          optimizer.step(fn)
      self.assertLess(fn().item(), initial_value)
  
file_path: MONAI/tests/test_optim_novograd.py
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from torch.autograd import Variable
  from monai.optimizers import Novograd
label_desc: Use image node_id 1 for calling the TestNovograd obj's underlying member method code with example usage: obj.test_step(specify_param, default_param, weight, bias, input) and returns: loss