class_docstr: Implementation of a Basic Iterative Pruner.
  Any iterative pruning technique can be extended from this by implementing the `prune_model` method.
  
  :param model: Model that needs to be pruned
  :type model: torch.nn.Module
  :param train_loader: Dataloader for training
  :type train_loader: torch.utils.data.DataLoader
  :param test_loader: Dataloader for validation/testing
  :type test_loader: torch.utils.data.DataLoader
  :param loss_fn: Loss function to be used for training
  :type loss_fn: torch.nn.Module
  :param device: Device used for implementation ("cpu" by default)
  :type device: torch.device
class_docstr_tok: ["Implementation","of","a","Basic","Iterative","Pruner",".","Any","iterative","pruning","technique","can","be","extended","from","this","by","implementing","the","`","prune_model","`","method",".",":","param","model",":","Model","that","needs","to","be","pruned",":","type","model",":","torch.nn.Module",":","param","train_loader",":","Dataloader","for","training",":","type","train_loader",":","torch.utils.data.DataLoader",":","param","test_loader",":","Dataloader","for","validation\/testing",":","type","test_loader",":","torch.utils.data.DataLoader",":","param","loss_fn",":","Loss","function","to","be","used","for","training",":","type","loss_fn",":","torch.nn.Module",":","param","device",":","Device","used","for","implementation","(","``","cpu","''","by","default",")",":","type","device",":","torch.device"]
code: def __init__(
      self,
      model,
      train_loader,
      test_loader,
      loss_fn=nn.CrossEntropyLoss(),
      device="cpu",
  ):
      self.device = device
      self.model = model.to(self.device)
      self.loss_fn = loss_fn
      self.train_loader = train_loader
      self.test_loader = test_loader
      self.optimizer = torch.optim.Adam(self.model.parameters())
  
file_path: KD_Lib/KD_Lib/Pruning/common/iterative_base_class.py
imports: import copy
  import numpy
  import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new BaseIterativePruner object  with example: obj = BaseIterativePruner(model, train_loader, test_loader, loss_fn, device)