NVIDIA / trt-samples-for-hackathon-cn

Simple samples for TensorRT programming
Apache License 2.0
1.48k stars 337 forks source link

Convert3DMMTo2DMM例子中 reshape维度问题? #25

Closed BaofengZan closed 2 years ago

BaofengZan commented 2 years ago

https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/32bb0afc33241f4553c643656fbf65290c0bc4db/cookbook/10-BestPractice/Convert3DMMTo2DMM/main.py#L128 这里输入的是B*T*1的tensor,不应该reshape成(BT)1吗? 为什么reshape成了256?

wili-65535 commented 2 years ago

感谢纠错!这个地方确实应该是 1 而不是 256。同理第 122 行 bTComma1Tensor 的形状也应该是 [2] 而不是 [1]。

不过,由于 TRT 在构建期会重新计算所有层的形状和数据类型,所以这里手工写进去的 256 会被 TRT 忽略掉,对构建没有影响。

BaofengZan commented 2 years ago

好的。感谢回答