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

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaiBapchya committed Aug 6, 2019
1 parent 2f0a163 commit 7d37257
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions benchmark/opperf/utils/benchmark_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _run_nd_operator_performance_test(op, inputs, run_backward, warmup, runs, ar
benchmark_helper_func = nd_forward_and_profile

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

# Add inputs used for profiling this operator into result
profiler_output["inputs"] = inputs[idx]
Expand Down
4 changes: 2 additions & 2 deletions benchmark/opperf/utils/ndarray_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def nd_forward_backward_and_profile(op, runs, *args, **kwargs):
"""
for _ in range(runs):
with mx.autograd.record():
if(args==(None,)):
if not isinstance(args[0],nd.NDArray):
res = op(**kwargs)
else:
res = op(*args, **kwargs)
Expand Down Expand Up @@ -79,7 +79,7 @@ def nd_forward_and_profile(op, runs, *args, **kwargs):
any results from NDArray operation execution
"""
for _ in range(runs):
if(args==(None,)):
if not isinstance(args[0],nd.NDArray):
res = op(**kwargs)
else:
res = op(*args, **kwargs)
Expand Down

0 comments on commit 7d37257

Please sign in to comment.