-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[SCU][Paddle TensorRT No.40] Add pd_op.index_select converter #69762
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
def index_select_converter(network, paddle_op, inputs): | ||
input_tensor = inputs[0] | ||
index_tensor = inputs[1] | ||
axis = paddle_op.attrs().get("dim", 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.
index_select的参数是axis,仔细看pd_op2.cc
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.
index_select_op.cc文件里的axis也是从dim属性里取值的,可能参数名就是dim?
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.
已修改
index_tensor = inputs[1] | ||
axis = paddle_op.attrs().get("axis", 0) | ||
|
||
gather_layer = network.add_gather(input_tensor, index_tensor, axis) |
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.
旧ir下这里是shuffle layer
fdfb55b
to
ee047cd
Compare
input_tensor, reshape_layer.get_output(0), axis | ||
) | ||
|
||
output_layer = network.add_shuffle(gather_layer.get_output(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.
旧ir下只有一个shuffle和gather层,这里为什么又加一个shuffle
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.
已修改
self.max_shape = {"x": [5, 3, 3], "index": [5]} | ||
|
||
def test_trt_result_fp16(self): | ||
self.check_trt_result(precision_mode="fp16") |
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.
这个输入是int64,怎么测试fp16的,这个什么也不填
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.
已修改
Sorry to inform you that b6dad59's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
PR Category
User Experience
PR Types
New features
Description
trt_op_maker_pass.cc文件里的相关内容已经改过了,所以没有再修改