class_docstr: Base default handler to load torchscript or eager mode [state_dict] models
  Also, provides handle method per torch serve custom model specification
class_docstr_tok: ["Base","default","handler","to","load","torchscript","or","eager","mode","[","state_dict","]","models","Also",",","provides","handle","method","per","torch","serve","custom","model","specification"]
docstr: The Inference Function is used to make a prediction call on the given input request.
  The user needs to override the inference function to customize it.
  
  Args:
      data (Torch Tensor): A Torch Tensor is passed to make the Inference Request.
      The shape should match the model input shape.
  
  Returns:
      Torch Tensor : The Predicted Torch Tensor is returned in this function.
docstr_tok: ["The","Inference","Function","is","used","to","make","a","prediction","call","on","the","given","input","request",".","The","user","needs","to","override","the","inference","function","to","customize","it",".","Args",":","data","(","Torch","Tensor",")",":","A","Torch","Tensor","is","passed","to","make","the","Inference","Request",".","The","shape","should","match","the","model","input","shape",".","Returns",":","Torch","Tensor",":","The","Predicted","Torch","Tensor","is","returned","in","this","function","."]
code: def inference(self, data, *args, **kwargs):
      """
      The Inference Function is used to make a prediction call on the given input request.
      The user needs to override the inference function to customize it.
  
      Args:
          data (Torch Tensor): A Torch Tensor is passed to make the Inference Request.
          The shape should match the model input shape.
  
      Returns:
          Torch Tensor : The Predicted Torch Tensor is returned in this function.
      """
      with torch.no_grad():
          marshalled_data = data.to(self.device)
          results = self.model(marshalled_data, *args, **kwargs)
      return results
  
imports: import abc
  import importlib.util
  import logging
  import os
  import time
  import torch
  from pkg_resources import packaging
  from ts.handler_utils.timer import timed
  from ..utils.util import check_valid_pt2_backend, list_classes_from_module, load_label_mapping
label_desc: Use image node_id 8 for calling the BaseHandler obj's underlying member method code with example usage: obj.inference(data) and returns: results