Shortcuts

ts.torch_handler package

Subpackages

Submodules

ts.torch_handler.base_handler module

ts.torch_handler.contractions module

contraction map for text classification models.

ts.torch_handler.densenet_handler module

Module for image classification default handler

class ts.torch_handler.densenet_handler.DenseNetHandler[source]

Bases: object

DenseNetHandler handler class. This handler takes an image and returns the name of object in that image.

handle(data, context)[source]

Entry point for default handler

inference(data, *args, **kwargs)[source]

Override to customize the inference :param data: Torch tensor, matching the model input shape :return: Prediction output as Torch tensor

initialize(context)[source]

First try to load torchscript else load eager mode state_dict based model

ts.torch_handler.densenet_handler.list_classes_from_module(module, parent_class=None)[source]

Parse user defined module to get all model service classes in it.

Parameters:
  • module

  • parent_class

Returns:

List of model service class definitions

ts.torch_handler.image_classifier module

ts.torch_handler.image_segmenter module

ts.torch_handler.object_detector module

ts.torch_handler.text_classifier module

ts.torch_handler.text_handler module

ts.torch_handler.vision_handler module

Module contents

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