Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 7d37257

Browse files
committed
try
1 parent 2f0a163 commit 7d37257

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

benchmark/opperf/utils/benchmark_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _run_nd_operator_performance_test(op, inputs, run_backward, warmup, runs, ar
5656
benchmark_helper_func = nd_forward_and_profile
5757

5858
if not args_list:
59-
_, _ = benchmark_helper_func(op, warmup, None, **kwargs_list[0])
59+
_, _ = benchmark_helper_func(op, warmup, [], **kwargs_list[0])
6060
else:
6161
# Warm up, ignore the profiler output
6262
_, _ = benchmark_helper_func(op, warmup, args_list[0], **kwargs_list[0])
@@ -66,7 +66,7 @@ def _run_nd_operator_performance_test(op, inputs, run_backward, warmup, runs, ar
6666
logging.info("Begin Benchmark - {name}".format(name=op.__name__))
6767
if not args_list:
6868
for idx, kwargs in enumerate(kwargs_list):
69-
_, profiler_output = benchmark_helper_func(op, runs, None, **kwargs)
69+
_, profiler_output = benchmark_helper_func(op, runs, [], **kwargs)
7070

7171
# Add inputs used for profiling this operator into result
7272
profiler_output["inputs"] = inputs[idx]

benchmark/opperf/utils/ndarray_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def nd_forward_backward_and_profile(op, runs, *args, **kwargs):
4747
"""
4848
for _ in range(runs):
4949
with mx.autograd.record():
50-
if(args==(None,)):
50+
if not isinstance(args[0],nd.NDArray):
5151
res = op(**kwargs)
5252
else:
5353
res = op(*args, **kwargs)
@@ -79,7 +79,7 @@ def nd_forward_and_profile(op, runs, *args, **kwargs):
7979
any results from NDArray operation execution
8080
"""
8181
for _ in range(runs):
82-
if(args==(None,)):
82+
if not isinstance(args[0],nd.NDArray):
8383
res = op(**kwargs)
8484
else:
8585
res = op(*args, **kwargs)

0 commit comments

Comments
 (0)