class_docstr: Test functionality of SkorchDoctor using a simple model
class_docstr_tok: ["Test","functionality","of","SkorchDoctor","using","a","simple","model"]
code: def test_hooks_cleaned_up_after_fit(self, doctor, data):
      # make sure that the hooks are cleaned up by checking that no more recs
      # are written when continuing to fit the net
      num_activation_recs_before = len(
          doctor.activation_recs_["module"]
      )
      num_gradient_recs_before = len(doctor.gradient_recs_["module"])
  
      net = doctor.net
      net.partial_fit(*data)
  
      num_activation_recs_after = len(doctor.activation_recs_["module"])
      num_gradient_recs_after = len(doctor.gradient_recs_["module"])
  
      assert num_activation_recs_before == num_activation_recs_after
      assert num_gradient_recs_before == num_gradient_recs_after
  
imports: import itertools
  from unittest import mock
  import numpy
  import pytest
  import torch
  from torch import nn
label_desc: Use image node_id 16 for calling the TestSkorchDoctorSimple obj's underlying member method code with example usage: obj.test_hooks_cleaned_up_after_fit(doctor, data) without return types