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

Commit

Permalink
test added
Browse files Browse the repository at this point in the history
  • Loading branch information
Roshrini committed Jan 3, 2019
1 parent 99a2943 commit 8eb1ba5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/python-pytest/onnx/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
'https://s3.amazonaws.com/download.onnx/models/opset_8/inception_v2.tar.gz'
}

test_model_path = "https://s3.amazonaws.com/onnx-mxnet/test_model.onnx"

def get_test_files(name):
"""Extract tar file and returns model path and input, output data"""
Expand Down Expand Up @@ -152,6 +153,16 @@ def get_model_results(modelpath):

logging.info(model_name + " conversion successful")

def test_nodims_import(self):
# Download test model without dims mentioned in params
test_model = download(test_model_path, dirname=CURR_PATH.__str__())
input_data = np.array([0.2, 0.5])
nd_data = mx.nd.array(input_data).expand_dims(0)
sym, arg_params, aux_params = onnx_mxnet.import_model(test_model)
model_metadata = onnx_mxnet.get_model_metadata(test_model)
input_names = [inputs[0] for inputs in model_metadata.get('input_tensor_data')]
output_data = forward_pass(sym, arg_params, aux_params, input_names, nd_data)
assert(output_data.shape == (1,1))

# test_case = ("model name", input shape, output shape)
test_cases = [
Expand Down

0 comments on commit 8eb1ba5

Please sign in to comment.