ts.utils package
Submodules
ts.utils.timeit_decorator module
timeit decorator
- ts.utils.timeit_decorator.timeit(func)[source]
Use this decorator on a method to find it’s execution time. :param func: :return:
ts.utils.util module
Utility functions for TorchServe
- class ts.utils.util.PT2Backend(value)[source]
-
An enumeration.
- ts.utils.util.deprecated(version, replacement='', klass=<class 'PendingDeprecationWarning'>)[source]
This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.
- Parameters:
version – The version in which the function will be removed.
replacement – The replacement function, if any.
klass – The category of warning
- ts.utils.util.get_yaml_config(yaml_file_path)[source]
- ts.utils.util.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.utils.util.load_label_mapping(mapping_file_path)[source]
Load a JSON mapping { class ID -> friendly class name }. Used in BaseHandler.
- ts.utils.util.map_class_to_label(probs, mapping=None, lbl_classes=None)[source]
Given a list of classes & probabilities, return a dictionary of { friendly class name -> probability }
Module contents
Util files for TorchServe