Zha0q1 commented on a change in pull request #20048:
URL: https://github.com/apache/incubator-mxnet/pull/20048#discussion_r598365876
##########
File path: tests/python-pytest/onnx/test_onnxruntime.py
##########
@@ -988,3 +988,170 @@ def test_ernie_inference_onnxruntime(tmp_path,
model_name):
finally:
shutil.rmtree(tmp_path)
+
+
+@with_seed()
[email protected]('model_name', ['transformer_en_de_512'])
+def test_transformer_pretrained_inference_onnxruntime(tmp_path, model_name):
+ tmp_path = str(tmp_path)
+ try:
+ import gluonnlp as nlp
+ dataset = 'WMT2014'
+ ctx = mx.cpu(0)
+ model, _, _ = nlp.model.get_model(
+ name=model_name,
+ ctx=ctx,
+ pretrained=True,
+ dataset_name=dataset)
+
+ model.hybridize(static_alloc=False)
+
+ batch = 7
+ seq_length = 16
+ C_in = 512
+ C_out = 512
+ src = mx.nd.random.uniform(0, 36794, shape=(batch, seq_length),
dtype='float32')
Review comment:
No it's float in the original mxnet model too. This should not matter I
think because the operator will apply ceiling/flooring
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]