Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RELAY][DOCS] Port from_mxnet tutorial to relay #2608

Merged
merged 2 commits into from
Feb 17, 2019

Conversation

eqy
Copy link
Contributor

@eqy eqy commented Feb 15, 2019

Port the prediction part of the NNVM from_mxnet tutorial to relay (note that the checkpointing part is omitted for now).

@eqy eqy force-pushed the relay_from_mxnet branch from 447525f to 349eb48 Compare February 15, 2019 23:33
@eqy eqy requested review from zhreshold and jroesch February 16, 2019 00:39
target = 'cuda'
shape_dict = {'data': x.shape}
with relay.build_config(opt_level=3):
graph, lib, params = relay.build_module.build(net, target, params=params)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think following is the recommended way to inference in Relay

with relay.build_config(opt_level=1):
    intrp = relay.build_module.create_executor('graph', sym, tvm.gpu(0), target)

tvm_output = intrp.evaluate(sym)(tvm.nd.array(x.astype(dtype)), **params).asnumpy()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the suggestion; looks like the output of the interpreter is already numpy?

Copy link
Member

@yzhliu yzhliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhreshold Please take a look again.

Copy link
Member

@zhreshold zhreshold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yzhliu yzhliu merged commit 231bac2 into apache:master Feb 17, 2019
@yzhliu
Copy link
Member

yzhliu commented Feb 17, 2019

Thanks @eqy @zhreshold This is merged.

libing4752 pushed a commit to libing4752/tvm that referenced this pull request Feb 18, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
@yzhliu yzhliu mentioned this pull request Mar 2, 2019
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants