-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
feature/mul converter #10841
feature/mul converter #10841
Conversation
…/refine-opconverter
5b30915
to
4ce465c
Compare
0f958b3
to
120075e
Compare
for (const auto& output : op_desc_->OutputArgumentNames()) { | ||
std::vector<float> fluid_out; | ||
std::vector<float> trt_out(200); | ||
engine_->GetOutputInCPU(output, &trt_out[0], 200 * sizeof(float)); |
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.
这里为什么是200呢?
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.
200 是 memory space,没有特殊意义
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.
可以加个注释说明下为什么取200,会不会以后不够大。
// Compare two output | ||
ASSERT_FALSE(fluid_out.empty()); | ||
for (size_t i = 0; i < fluid_out.size(); i++) { | ||
EXPECT_LT(std::abs(fluid_out[i] - trt_out[i]), 0.001); |
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.
0.001有点太大了。e-6?
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.
准备在下个pr改过去
framework::OpDesc op_desc(op, nullptr, nullptr); | ||
// Declare inputs | ||
auto* input1 = engine_->GetITensor(op_desc.Input("X")[0]); | ||
auto* input2 = engine_->GetITensor(op_desc.Input("Y")[0]); |
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.
Y这个值是weight,是存在scope里的,不是从GetITensor取的。
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.
这里 X,Y 的确是在 TensorRT 空间的,具体怎么把叫 X, Y 的 Tensor 从 Scope 拷贝到 TensorRT 里,是外层的其他逻辑去控制,ut里是一个framework去做这个
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.
LGTM! 一些comment在下一个PR进行修改。
Add mul-op with a UT framework to test TensorRT op converter.