Skip to content

libtorch jit forward error #221

Answered by moodeerf
moodeerf asked this question in Q&A
Discussion options

You must be logged in to vote

Firstly I had used other jit models,.forward() can be invoked correctly , so most likely not the issue of libtorch itself, idk.

With multiple input variables?
Hi,
Finally i solved the problem like this .
std::vector<torch::jit::IValue> inputs;
inputs.push_back(torch::from_blob(buffer,{chunk_size},torch::kFloat32));
int sr = 16000;
inputs.push_back(sr);
at::Tensor output = module.forward(inputs).toTensor();

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by snakers4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #220 on August 23, 2022 04:38.