class_docstr: Handler for TorchRec DLRM example
class_docstr_tok: ["Handler","for","TorchRec","DLRM","example"]
docstr: The post process function converts the prediction response into a
     Torchserve compatible format
  
  Args:
      data (Torch Tensor): The data parameter comes from the prediction output
      output_explain (None): Defaults to None.
  
  Returns:
      (list): Returns the response containing the predictions which consist of a single score per input entry.
docstr_tok: ["The","post","process","function","converts","the","prediction","response","into","a","Torchserve","compatible","format","Args",":","data","(","Torch","Tensor",")",":","The","data","parameter","comes","from","the","prediction","output","output_explain","(","None",")",":","Defaults","to","None",".","Returns",":","(","list",")",":","Returns","the","response","containing","the","predictions","which","consist","of","a","single","score","per","input","entry","."]
code: def postprocess(self, data):
      """
      The post process function converts the prediction response into a
         Torchserve compatible format
  
      Args:
          data (Torch Tensor): The data parameter comes from the prediction output
          output_explain (None): Defaults to None.
  
      Returns:
          (list): Returns the response containing the predictions which consist of a single score per input entry.
      """
  
      result = []
      for item in data:
          res = {}
          res["score"] = item.squeeze().float().tolist()
          result.append(res)
  
      return result
  
file_path: serve/examples/torchrec_dlrm/dlrm_handler.py
imports: import json
  import logging
  import os
  from abc import ABC
  import torch
  from torchrec.datasets.criteo import DEFAULT_CAT_NAMES
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor
  from ts.torch_handler.base_handler import BaseHandler
label_desc: Use image node_id 4 for calling the TorchRecDLRMHandler obj's underlying member method code with example usage: obj.postprocess(data) and returns: result