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

[OpPerf] Fixes the issue when you pass NDArray to run_perf_test #17508

Merged
merged 2 commits into from
Feb 4, 2020

Commits on Feb 2, 2020

  1. Fix typeError

    Fixes the issue when you pass NDArray to the opperf. It errors out 
    ```
    run_performance_test(nd.gather_nd, inputs=[{"data": (2, 22), "indices":nd.random_uniform(low=0,high=1,shape=(1,2))}], run_backward=T
    rue, warmup=1, runs=1)
    TypeError: isinstance() arg 2 must be a type or tuple of types
    ```
    ChaiBapchya committed Feb 2, 2020
    Configuration menu
    Copy the full SHA
    763a6a0 View commit details
    Browse the repository at this point in the history
  2. Fix unexpected keyword argument 'ctx' error

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/ubuntu/incubator-mxnet/benchmark/opperf/utils/benchmark_utils.py", line 133, in run_performance_test
        args_list, kwargs_list = _prepare_op_inputs(inputs, run_backward, dtype, ctx)
      File "/home/ubuntu/incubator-mxnet/benchmark/opperf/utils/benchmark_utils.py", line 50, in _prepare_op_inputs
        attach_grad=run_backward)
      File "/home/ubuntu/incubator-mxnet/benchmark/opperf/utils/ndarray_utils.py", line 120, in get_mx_ndarray
        tensor = in_tensor.as_in_context(ctx=ctx).astype(dtype=dtype)
    TypeError: as_in_context() got an unexpected keyword argument 'ctx'
    ChaiBapchya committed Feb 2, 2020
    Configuration menu
    Copy the full SHA
    c19eec5 View commit details
    Browse the repository at this point in the history