diff --git a/runtime/onert/api/python/package/__init__.py b/runtime/onert/api/python/package/__init__.py index 2c5e133de3f..71b5512dd0f 100644 --- a/runtime/onert/api/python/package/__init__.py +++ b/runtime/onert/api/python/package/__init__.py @@ -5,7 +5,7 @@ from . import infer # Import and expose tensorinfo -from .common import tensorinfo as tensorinfo +from .common import tensorinfo # Import and expose the experimental module's functionalities from . import experimental diff --git a/runtime/onert/api/python/package/common/basesession.py b/runtime/onert/api/python/package/common/basesession.py index d651ddbf3d1..edad146e3ea 100644 --- a/runtime/onert/api/python/package/common/basesession.py +++ b/runtime/onert/api/python/package/common/basesession.py @@ -1,7 +1,7 @@ from typing import List import numpy as np -from ..native.libnnfw_api_pybind import infer, tensorinfo +from ..native.libnnfw_api_pybind import tensorinfo from ..native.libnnfw_api_pybind.exception import OnertError @@ -176,18 +176,3 @@ def _set_outputs(self, size): raise OnertError(f"Failed to get output #{i}: {e}") from e self.outputs.append(output_array) - - -def tensorinfo(): - """ - Shortcut to create a fresh tensorinfo instance. - Raises: - OnertError: If the C-API call fails. - """ - - try: - return infer.nnfw_tensorinfo() - except OnertError: - raise - except Exception as e: - raise OnertError(f"Failed to create tensorinfo: {e}") from e diff --git a/runtime/onert/sample/minimal-python/inference_benchmark.py b/runtime/onert/sample/minimal-python/inference_benchmark.py index 443f7a29d39..e1a00781182 100644 --- a/runtime/onert/sample/minimal-python/inference_benchmark.py +++ b/runtime/onert/sample/minimal-python/inference_benchmark.py @@ -3,9 +3,7 @@ import psutil import os from typing import List -from onert import infer -# TODO: Import tensorinfo from onert -from onert.native.libnnfw_api_pybind import tensorinfo +from onert import infer, tensorinfo def get_memory_usage_mb() -> float: