class_docstr: Test functionality of SkorchDoctor using a simple model
class_docstr_tok: ["Test","functionality","of","SkorchDoctor","using","a","simple","model"]
code: def test_recs_with_filter(
      self, module_cls, net_cls, doctor_cls, data, custom_split
  ):
      # when initializing SkorchDoctor with a match_fn, only records whose
      # keys match should be kept
      def match_fn(name):
          return "lin0" in name
  
      net = net_cls(
          module_cls,
          max_epochs=3,
          batch_size=32,
          train_split=custom_split,
      )
      doctor = doctor_cls(net, match_fn=match_fn)
      doctor.fit(*data)
  
      # check trivial case of empty lists
      assert doctor.activation_recs_["module"]
      assert doctor.gradient_recs_["module"]
      assert doctor.param_update_recs_["module"]
  
      for rec in doctor.activation_recs_["module"]:
          for key in rec.keys():
              assert match_fn(key)
  
      for rec in doctor.gradient_recs_["module"]:
          for key in rec.keys():
              assert match_fn(key)
  
      for rec in doctor.param_update_recs_["module"]:
          for key in rec.keys():
              assert match_fn(key)
  
imports: import itertools
  from unittest import mock
  import numpy
  import pytest
  import torch
  from torch import nn
label_desc: Use image node_id 23 for calling the TestSkorchDoctorSimple obj's underlying member method code with example usage: obj.test_recs_with_filter(module_cls, net_cls, doctor_cls, data, custom_split) and returns: unknown