class_docstr: Basic Implementation of Quantization for PyTorch models.
  
  :param model: Model that needs to be pruned
  :type model: torch.nn.Module
  :param qconfig: Configuration used for quantization
  :type qconfig: Qconfig
  :param train_loader: DataLoader used for training
  :type train_loader: torch.utils.data.DataLoader
  :param test_loader: DataLoader used for testing
  :type test_loader: torch.utils.data.DataLoader
  :param optimizer: Optimizer for training
  :type optimizer: torch.optim.*
  :param criterion: Loss function used for calibration
  :type criterion: Loss_fn
  :param device: Device used for training ("cpu" or "cuda")
  :type device: torch.device
class_docstr_tok: ["Basic","Implementation","of","Quantization","for","PyTorch","models",".",":","param","model",":","Model","that","needs","to","be","pruned",":","type","model",":","torch.nn.Module",":","param","qconfig",":","Configuration","used","for","quantization",":","type","qconfig",":","Qconfig",":","param","train_loader",":","DataLoader","used","for","training",":","type","train_loader",":","torch.utils.data.DataLoader",":","param","test_loader",":","DataLoader","used","for","testing",":","type","test_loader",":","torch.utils.data.DataLoader",":","param","optimizer",":","Optimizer","for","training",":","type","optimizer",":","torch.optim",".","*",":","param","criterion",":","Loss","function","used","for","calibration",":","type","criterion",":","Loss_fn",":","param","device",":","Device","used","for","training","(","``","cpu","''","or","``","cuda","''",")",":","type","device",":","torch.device"]
docstr: Function used for evaluating the model
  
  :param model: Model
  :type model: torch.nn.Module
docstr_tok: ["Function","used","for","evaluating","the","model",":","param","model",":","Model",":","type","model",":","torch.nn.Module"]
code: def _evaluate_model(self, model):
      """
      Function used for evaluating the model
  
      :param model: Model
      :type model: torch.nn.Module
      """
  
      model.eval()
      correct = 0
      len_dataset = len(self.test_loader.dataset)
  
      with torch.no_grad():
          for image, target in self.test_loader:
              output = model(image)
  
              if isinstance(output, tuple):
                  output = output[0]
  
              pred = output.argmax(dim=1, keepdim=True)
              correct += pred.eq(target.view_as(pred)).sum().item()
  
      return correct / len_dataset
  
file_path: KD_Lib/KD_Lib/Quantization/common/base_class.py
imports: import os
  import time
  import torch
label_desc: Use image node_id 7 for calling the Quantizer obj's underlying member method code with example usage: obj._evaluate_model(model) and returns: unknown