提交 883957ac 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!4676 Add DecodeOp c++ parameter validate

Merge pull request !4676 from xiefangqi/xfq_fix_decode_twice
......@@ -32,6 +32,10 @@ DecodeOp::DecodeOp(bool is_rgb_format) : is_rgb_format_(is_rgb_format) {
Status DecodeOp::Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) {
IO_CHECK(input, output);
// check the input tensor shape
if (input->Rank() != 1) {
RETURN_STATUS_UNEXPECTED("DecodeOp error: invalid input shape, only support 1D input.");
}
if (is_rgb_format_) { // RGB colour mode
return Decode(input, output);
} else { // BGR colour mode
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册