Skip to content

Commit 9d8f9ef

Browse files
authored
[onert] Remove unused tensorinfo function from common module (#16193)
This commit removes unused and broken tensorinfo() function from the common Python module. Removing this function allows to properly use the native tensorinfo structure from the onert top level module. ONE-DCO-1.0-Signed-off-by: Arkadiusz Bokowy <a.bokowy@samsung.com>
1 parent 2eb53a9 commit 9d8f9ef

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

runtime/onert/api/python/package/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from . import infer
66

77
# Import and expose tensorinfo
8-
from .common import tensorinfo as tensorinfo
8+
from .common import tensorinfo
99

1010
# Import and expose the experimental module's functionalities
1111
from . import experimental

runtime/onert/api/python/package/common/basesession.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import List
22
import numpy as np
33

4-
from ..native.libnnfw_api_pybind import infer, tensorinfo
4+
from ..native.libnnfw_api_pybind import tensorinfo
55
from ..native.libnnfw_api_pybind.exception import OnertError
66

77

@@ -176,18 +176,3 @@ def _set_outputs(self, size):
176176
raise OnertError(f"Failed to get output #{i}: {e}") from e
177177

178178
self.outputs.append(output_array)
179-
180-
181-
def tensorinfo():
182-
"""
183-
Shortcut to create a fresh tensorinfo instance.
184-
Raises:
185-
OnertError: If the C-API call fails.
186-
"""
187-
188-
try:
189-
return infer.nnfw_tensorinfo()
190-
except OnertError:
191-
raise
192-
except Exception as e:
193-
raise OnertError(f"Failed to create tensorinfo: {e}") from e

runtime/onert/sample/minimal-python/inference_benchmark.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import psutil
44
import os
55
from typing import List
6-
from onert import infer
7-
# TODO: Import tensorinfo from onert
8-
from onert.native.libnnfw_api_pybind import tensorinfo
6+
from onert import infer, tensorinfo
97

108

119
def get_memory_usage_mb() -> float:

0 commit comments

Comments
 (0)