Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/onert/api/python/package/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 1 addition & 16 deletions runtime/onert/api/python/package/common/basesession.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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
4 changes: 1 addition & 3 deletions runtime/onert/sample/minimal-python/inference_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down