未验证 提交 864c1676 编写于 作者: Q qinhj 提交者: GitHub

[operator] prototype/reshape: check reshaped size with input size during infer shape (#701)

上级 91b7ca4a
......@@ -30,6 +30,7 @@
#include "module/module.h"
#include "utility/sys_port.h"
#include "utility/vector.h"
#include "utility/log.h"
#include <string.h>
......@@ -115,6 +116,11 @@ static int infer_shape(struct node* node)
else
new_size *= temp;
}
// check input and reshaped size
if (new_size != size) {
TLOG_ERR("Error: input elem num(%d) != reshaped elem num(%d)\n", size, new_size);
return -1;
}
if (idx >= 0)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册