code: def setUp(self) -> None:
      torch.manual_seed(42)
      self.pytorch_network = nn.Sequential(
          nn.Linear(1, 2), nn.Linear(2, 1)
      )
      self.loss_function = nn.MSELoss()
      self.optimizer = torch.optim.SGD(
          self.pytorch_network.parameters(), lr=1e-3
      )
      self.model = Model(
          self.pytorch_network, self.optimizer, self.loss_function
      )
  
file_path: poutyne/tests/framework/callbacks/test_terminate_on_nan.py
imports: import numpy
  import torch
  import torch.nn
  from poutyne import Model, TerminateOnNaN
  from tests.framework.base import CaptureOutputBase
  from tests.framework.tools import some_data_generator
label_desc: Use image node_id 1 for calling the TerminateOnNaNTest obj's underlying member method code with example usage: obj.setUp() without return types