nncf/torch/exporter.py
def export_model(self, save_path: str, save_format: Optional[str] = None) -> None:
        """
        Exports the compressed model to the specified format.

        :param save_path: The path where the model will be saved.
        :param save_format: Saving format.
            One of the following:
                - `onnx` for export to the ONNX format.
                - `onnx_<opset_version>` for export to the ONNX format with specific opset version.
            The ONNX format will be used if `save_format` is not specified.
        """
        fn_args = {'save_path': save_path}

        if save_format is None:
            save_format = PTExporter._ONNX_FORMAT

        save_format, extra_args = PTExporter.parse_format(save_format)
        fn_args.update(extra_args)

        format_to_export_fn = {
            PTExporter._ONNX_FORMAT: self._export_to_onnx,
        }

        export_fn = format_to_export_fn.get(save_format)

        if export_fn is None:
            available_formats = list(format_to_export_fn.keys())
            raise ValueError(f'Unsupported saving format: \'{save_format}\'. '
                             f'Available formats: {available_formats}')

        export_fn(**fn_args)

        Exports the compressed model to the specified format.

        :param save_path: The path where the model will be saved.
        :param save_format: Saving format.
            One of the following:
                - `onnx` for export to the ONNX format.
                - `onnx_<opset_version>` for export to the ONNX format with specific opset version.
            The ONNX format will be used if `save_format` is not specified.
        
Exports the compressed model to the specified format.
Exports the compressed model to the specified format .
def export_model(self, save_path: str, save_format: Optional[str] = None) -> None:
        fn_args = {'save_path': save_path}
        if save_format is None:
            save_format = PTExporter._ONNX_FORMAT
        save_format, extra_args = PTExporter.parse_format(save_format)
        fn_args.update(extra_args)
        format_to_export_fn = {
            PTExporter._ONNX_FORMAT: self._export_to_onnx,
        }
        export_fn = format_to_export_fn.get(save_format)
        if export_fn is None:
            available_formats = list(format_to_export_fn.keys())
            raise ValueError(f'Unsupported saving format: \'{save_format}\'. '
                             f'Available formats: {available_formats}')
        export_fn(**fn_args)
def export_model ( self , save_path : str , save_format : Optional [ str ] = None ) -> None : fn_args = { 'save_path' : save_path } if save_format is None : save_format = PTExporter . _ONNX_FORMAT save_format , extra_args = PTExporter . parse_format ( save_format ) fn_args . update ( extra_args ) format_to_export_fn = { PTExporter . _ONNX_FORMAT : self . _export_to_onnx , } export_fn = format_to_export_fn . get ( save_format ) if export_fn is None : available_formats = list ( format_to_export_fn . keys ( ) ) raise ValueError ( f'Unsupported saving format: \'{save_format}\'. ' f'Available formats: {available_formats}' ) export_fn ( ** fn_args )
Exports the compressed model to the specified format.
Exports the compressed model to the specified format .
"""
        Exports the compressed model to the specified format.

        :param save_path: The path where the model will be saved.
        :param save_format: Saving format.
            One of the following:
                - `onnx` for export to the ONNX format.
                - `onnx_<opset_version>` for export to the ONNX format with specific opset version.
            The ONNX format will be used if `save_format` is not specified.
        """
self
save_path
str
The path where the model will be saved.
The path where the model will be saved .
save_format
Optional[str]
Saving format.
One of the following:
`onnx` for export to the ONNX format.
`onnx_` for export to the ONNX format with specific opset version.
The ONNX format will be used if `save_format` is not specified.
Saving format . One of the following : ` onnx ` for export to the ONNX format . ` onnx_ ` for export to the ONNX format with specific opset version . The ONNX format will be used if ` save_format ` is not specified .