Skip to content

Commit 8571c08

Browse files
committed
[onert] Fix Python typing for the benchmark_inference() function
This commits fixes the typing by allowing passing None as a value for the input_shapes parameter in the benchmark_inference() function. In case of input_shapes being None, the function uses the shape retrieved from the initialized session. ONE-DCO-1.0-Signed-off-by: Arkadiusz Bokowy <a.bokowy@samsung.com>
1 parent d84669e commit 8571c08

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55
import psutil
66
import os
7-
from typing import List
7+
from typing import List, Optional
88
from onert import infer, tensorinfo
99

1010

@@ -47,7 +47,7 @@ def get_validated_input_tensorinfos(sess: infer.session,
4747
return updated_infos
4848

4949

50-
def benchmark_inference(nnpackage_path: str, backends: str, input_shapes: List[List[int]],
50+
def benchmark_inference(nnpackage_path: str, backends: str, input_shapes: Optional[List[List[int]]],
5151
repeat: int):
5252
mem_before_kb = get_memory_usage_mb() * 1024
5353

0 commit comments

Comments
 (0)