Shortcuts

ts.torch_handler.unit_tests package

Subpackages

Submodules

ts.torch_handler.unit_tests.test_base_handler module

Basic unit test for BaseHandler class. Ensures it can load and execute an example model

ts.torch_handler.unit_tests.test_base_handler.handler(base_model_context)[source]
ts.torch_handler.unit_tests.test_base_handler.test_batch_handle(handler, base_model_context)[source]
ts.torch_handler.unit_tests.test_base_handler.test_inference_with_profiler_works_with_custom_initialize_method(handler, base_model_context)[source]
ts.torch_handler.unit_tests.test_base_handler.test_single_handle(handler, base_model_context)[source]

ts.torch_handler.unit_tests.test_envelopes module

Basic unit test for BaseHandler class. Ensures it can load and execute an example model

ts.torch_handler.unit_tests.test_envelopes.handle_fn(base_model_context)[source]
ts.torch_handler.unit_tests.test_envelopes.test_binary(base_model_context)[source]
ts.torch_handler.unit_tests.test_envelopes.test_body(handle_fn, base_model_context)[source]
ts.torch_handler.unit_tests.test_envelopes.test_json(handle_fn, base_model_context)[source]
ts.torch_handler.unit_tests.test_envelopes.test_json_batch(handle_fn, base_model_context)[source]
ts.torch_handler.unit_tests.test_envelopes.test_json_double_batch(handle_fn, base_model_context)[source]

More complex test case. Makes sure the model can mux several batches and return the demuxed results

ts.torch_handler.unit_tests.test_image_classifier module

Basic unit test for ImageClassifier class. Ensures it can load and execute an example model

ts.torch_handler.unit_tests.test_image_classifier.context(model_dir, model_name)[source]
ts.torch_handler.unit_tests.test_image_classifier.handler(context)[source]
ts.torch_handler.unit_tests.test_image_classifier.image_bytes()[source]
ts.torch_handler.unit_tests.test_image_classifier.model_dir(tmp_path_factory, model_name)[source]
ts.torch_handler.unit_tests.test_image_classifier.model_name()[source]
ts.torch_handler.unit_tests.test_image_classifier.test_handle(context, image_bytes, handler)[source]
ts.torch_handler.unit_tests.test_image_classifier.test_handle_explain(context, image_bytes, handler)[source]

ts.torch_handler.unit_tests.test_image_segmenter module

Basic unit test for ImageSegmenter class. Ensures it can load and execute an example model

ts.torch_handler.unit_tests.test_image_segmenter.context(model_dir, model_name)[source]
ts.torch_handler.unit_tests.test_image_segmenter.handler(context)[source]
ts.torch_handler.unit_tests.test_image_segmenter.image_bytes()[source]
ts.torch_handler.unit_tests.test_image_segmenter.model_dir(tmp_path_factory, model_name)[source]
ts.torch_handler.unit_tests.test_image_segmenter.model_name()[source]
ts.torch_handler.unit_tests.test_image_segmenter.test_handle(handler, context, image_bytes)[source]

ts.torch_handler.unit_tests.test_mnist_kf module

ts.torch_handler.unit_tests.test_object_detector module

Basic unit test for ObjectDetector class. Ensures it can load and execute an example model

ts.torch_handler.unit_tests.test_object_detector.context(model_dir, model_name)[source]
ts.torch_handler.unit_tests.test_object_detector.handler(context)[source]
ts.torch_handler.unit_tests.test_object_detector.image_bytes()[source]
ts.torch_handler.unit_tests.test_object_detector.model_dir(tmp_path_factory, model_name)[source]
ts.torch_handler.unit_tests.test_object_detector.model_name()[source]
ts.torch_handler.unit_tests.test_object_detector.test_handle(handler, context, image_bytes)[source]

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