快捷方式

ts.torch_handler.unit_tests 包

子包

子模块

ts.torch_handler.unit_tests.test_base_handler 模块

BaseHandler 类的基本单元测试。确保它可以加载和执行示例模型

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 模块

BaseHandler 类的基本单元测试。确保它可以加载和执行示例模型

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]

更复杂的测试用例。确保模型可以混合多个批次并返回解复用结果

ts.torch_handler.unit_tests.test_image_classifier 模块

ImageClassifier 类的基本单元测试。确保它可以加载和执行示例模型

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 模块

ImageSegmenter 类的基本单元测试。确保它可以加载并执行示例模型

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 模块

ts.torch_handler.unit_tests.test_object_detector 模块

ObjectDetector 类的基本单元测试。确保它可以加载并执行示例模型

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]

模块内容

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

获取针对初学者和高级开发者的深入教程

查看教程

资源

查找开发资源并获得问题的解答

查看资源