未验证 提交 2a9c7b5d 编写于 作者: X xjmxyt 提交者: GitHub

fix set value convert out of bound (#51885)

* fix out of bound

* fix bug

* fix bug

* fix
上级 81054ad4
......@@ -44,7 +44,7 @@ namespace tensorrt {
// for h in [0,n)
// for w in [0,n)
// output[n,c,indices[n,c,h,w],w] = updates[n,c,h,w]]
//
class SetValueConverter : public OpConverter {
public:
void operator()(const framework::proto::OpDesc& op,
......@@ -75,6 +75,10 @@ class SetValueConverter : public OpConverter {
axes = input_dims.nbDims - 1;
}
if (ends == -1 || ends > input_dims.d[axes]) {
ends = input_dims.d[axes];
}
if (axes >= input_dims.nbDims) {
platform::errors::InvalidArgument(
"The axes %d is larger than total axes %d", axes, input_dims.nbDims);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册