class_docstr: DenseNetHandler handler class. This handler takes an image
  and returns the name of object in that image.
class_docstr_tok: ["DenseNetHandler","handler","class",".","This","handler","takes","an","image","and","returns","the","name","of","object","in","that","image","."]
docstr: Entry point for default handler
docstr_tok: ["Entry","point","for","default","handler"]
code: def handle(self, data, context):
      """
      Entry point for default handler
      """
  
      # It can be used for pre or post processing if needed as additional request
      # information is available in context
      start_time = time.time()
  
      self.context = context
      metrics = self.context.metrics
  
      values = []
      for row in data:
          image = row.get("data") or row.get("body")
          tensor = torch.load(io.BytesIO(image))
          values.append(tensor)
      data = self.inference(torch.stack(values))
  
      stop_time = time.time()
      metrics.add_time(
          "HandlerTime",
          round((stop_time - start_time) * 1000, 2),
          None,
          "ms",
      )
      return [data]
  
file_path: serve/ts/torch_handler/densenet_handler.py
imports: import inspect
  import logging
  import os
  import importlib.util
  import time
  import io
  import torch
label_desc: Use image node_id 6 for calling the DenseNetHandler obj's underlying member method code with example usage: obj.handle(data, context) and returns: list