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

A question #74

Closed
cvchanghao opened this issue Oct 19, 2020 · 2 comments
Closed

A question #74

cvchanghao opened this issue Oct 19, 2020 · 2 comments

Comments

@cvchanghao
Copy link

I use torch.jit.trace() and save my own CNN_model. The return of my network is a tuple contains 3 tensors.
When I use C++ as front, I use auto output = module.forward(inputs); to get my result. But how can I get the 3 tensors individually? and do some C++ operations?

Thank you!

@mfl28
Copy link
Collaborator

mfl28 commented Oct 19, 2020

script::module's forward method returns an IValue type that has many methods to convert to other types, see here. You might want to try toTensorList(), toTensorVector() or toTuple().

@mfl28
Copy link
Collaborator

mfl28 commented Oct 26, 2020

Closing this for now, hope I could help you with your problem :)

@mfl28 mfl28 closed this as completed Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants