emmi_inference.common¶
Classes¶
Supported on-disk formats for tensor outputs. |
|
How to persist mapping outputs. |
Functions¶
|
Sanitize a suffix for safe filesystem usage. |
Module Contents¶
- class emmi_inference.common.SaveFormat¶
-
Supported on-disk formats for tensor outputs.
- Values:
PYTORCH_PT: PyTorch serialized tensor/map (
.pt). PYTORCH_TH: Alias, normalized to.pt. PYTORCH_PTH: Alias, normalized to.pt. NUMPY_NPY: NumPy array (.npy) for single tensors. NUMPY_NPZ: Compressed NumPy archive (.npz) for mappings.
Initialize self. See help(type(self)) for accurate signature.
- PYTORCH_PT = 'pt'¶
- PYTORCH_TH = 'th'¶
- PYTORCH_PTH = 'pth'¶
- NUMPY_NPY = 'npy'¶
- NUMPY_NPZ = 'npz'¶
- classmethod normalize(save_format)¶
Return the canonical save format.
- Parameters:
save_format (SaveFormat) – A concrete SaveFormat.
- Returns:
PYTORCH_PTwhen givenPYTORCH_TH/PYTORCH_PTH, otherwise the input value.- Return type:
- class emmi_inference.common.DictMode¶
-
How to persist mapping outputs.
- Values:
SPLIT: Write one file per key (suffix
_keyappended to the stem). SINGLE: Write a single container file containing all key/value pairs.
Initialize self. See help(type(self)) for accurate signature.
- SPLIT = 'split'¶
- SINGLE = 'single'¶