code: def _update_model(self, generator):
      self.pytorch_network.zero_grad()
  
      x, y = next(generator)
      pred_y = self.pytorch_network(x)
      loss = self.loss_function(pred_y, y)
      loss.backward()
  
      self.optimizer.step()
  
      return float(loss)
  
file_path: poutyne/tests/framework/callbacks/test_optimizer_checkpoint.py
imports: import os
  import unittest
  from tempfile import TemporaryDirectory
  from unittest import TestCase
  import torch
  import torch.nn
  from poutyne import Model, OptimizerCheckpoint, torch_to_numpy
  from tests.framework.tools import some_data_generator
label_desc: Use image node_id 6 for calling the OptimizerCheckpointTest obj's underlying member method code with example usage: obj._update_model(generator) and returns: float