code: def test_basic_opt(self):
      p = torch.tensor([2.0, 1.0, 10.0])
      training_steps = 1000
  
      model = NetWithState(p)
      optim = torch.optim.SGD(model.parameters(), lr=0.01)
  
      trial = (
          torchbearer.Trial(model, optim, loss)
          .for_train_steps(training_steps)
          .for_val_steps(1)
          .for_test_steps(1)
      )
      trial.run()
      trial.predict()
      trial.evaluate()
  
      self.assertAlmostEqual(model.pars[0].item(), 5.0, places=4)
      self.assertAlmostEqual(model.pars[1].item(), 0.0, places=4)
      self.assertAlmostEqual(model.pars[2].item(), 1.0, places=4)
  
imports: import unittest
  import torch
  from torch.nn import Module, Linear
  import torch.nn.init
  import torchbearer
  from torchbearer import callbacks
label_desc: Use image node_id 1 for calling the TestEndToEnd obj's underlying member method code with example usage: obj.test_basic_opt() without return types