Shortcuts

Source code for ts.torch_handler.request_envelope.body

"""
Default class for all handlers. Grabs the data out of the request body.
"""

from .base import BaseEnvelope

[docs]class BodyEnvelope(BaseEnvelope): """ Gets the key "body" from the input data, returns a raw list """
[docs] def parse_input(self, data): return [row.get("data") or row.get("body") for row in data]
[docs] def format_output(self, data): return data

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources