-
Notifications
You must be signed in to change notification settings - Fork 364
fix bugs in embedding converter #403
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,7 @@ TEST(Converters, ATenEmbeddingConvertsCorrectly) { | |
auto jit_results = trtorch::tests::util::RunGraph(g, params, {jit_in}); | ||
|
||
// Run TensorRT | ||
auto options_trt = torch::TensorOptions().device(torch::kCUDA, 0).dtype(torch::kI32); | ||
auto options_trt = torch::TensorOptions().device(torch::kCUDA, 0).dtype(torch::kFloat); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do the indices only come in float? can they come in other types? We should maybe instead duplicate instead of modifying the test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When using setType function in embbedding converter, the input data type will be changed from kFloat to kInt32. But i have replaced setType function with addIdentity function, the input data type will not change. If i still use kInt32, it will get an error like that "Expected inputs[pyt_idx].dtype() == expected_type to be true but got false. Expected input tensors to have type Float, found type int". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this is a good catch, I was just wondering about the test and why it wasnt duplicated. I think its not a massive deal, other than that this patch lgtm |
||
auto trt_in = at::tensor({0, 1, 2}, options_trt); | ||
auto trt_results = trtorch::tests::util::RunGraphEngine(g, params, {trt_in}); | ||
auto trt = trt_results[0].reshape(jit_results[0].sizes()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only modified this part in select.cpp.