Download ScaleDF_rebuttal/python_dedup_pkgs/onnx/printer.py from VideoUFO/ResearchData_P1: direct link, hf CLI and curl.
- Browser
- Download file 755 Bytes
-
https://huggingface.co/datasets/VideoUFO/ResearchData_P1/resolve/main/ScaleDF_rebuttal/python_dedup_pkgs/onnx/printer.py
- Command line
-
hf download hf://datasets/VideoUFO/ResearchData_P1/ScaleDF_rebuttal/python_dedup_pkgs/onnx/printer.py
-
curl -L -o printer.py https://huggingface.co/datasets/VideoUFO/ResearchData_P1/resolve/main/ScaleDF_rebuttal/python_dedup_pkgs/onnx/printer.py
755 Bytes
| # Copyright (c) ONNX Project Contributors | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| from __future__ import annotations | |
| import onnx | |
| import onnx.onnx_cpp2py_export.printer as C # noqa: N812 | |
| def to_text( | |
| proto: onnx.ModelProto | onnx.FunctionProto | onnx.GraphProto | onnx.NodeProto, | |
| ) -> str: | |
| if isinstance(proto, onnx.ModelProto): | |
| return C.model_to_text(proto.SerializeToString()) | |
| if isinstance(proto, onnx.FunctionProto): | |
| return C.function_to_text(proto.SerializeToString()) | |
| if isinstance(proto, onnx.GraphProto): | |
| return C.graph_to_text(proto.SerializeToString()) | |
| if isinstance(proto, onnx.NodeProto): | |
| return C.node_to_text(proto.SerializeToString()) | |
| raise TypeError("Unsupported argument type.") | |