!8518 [MS][LITE]Fix Matmul

From: @gongdaguo
Reviewed-by: @zhang_xue_tong,@zhanghaibo5
Signed-off-by: @zhang_xue_tong
pull/8518/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit ffcea11967

@ -116,8 +116,8 @@ int MatMul::InferShape(std::vector<Tensor *> inputs_, std::vector<Tensor *> outp
MS_LOG(ERROR) << "inputs shape is invalid";
return RET_INPUT_TENSOR_ERROR;
}
for (size_t i = 0; i < a_shape.size() - 2; ++i) {
if (a_shape[i] != b_shape[i]) {
for (size_t i = 0; i < (a_shape.size() - 2) && i < (b_shape.size() - 2); ++i) {
if (a_shape[a_shape.size() - 3 - i] != b_shape[b_shape.size() - 3 - i]) {
MS_LOG(ERROR) << "Op MatMul's dimensions must be equal";
return RET_INPUT_TENSOR_ERROR;
}

@ -124,7 +124,6 @@ int Transpose::InferShape(std::vector<Tensor *> inputs_, std::vector<Tensor *> o
if (!GetInferFlag()) {
return RET_OK;
}
MS_ASSERT(inputs_.size() == kDoubleNum);
MS_ASSERT(outputs_.size() == kSingleNum);
int conjugate = GetConjugate();

@ -116,7 +116,6 @@ int TransposeFp32Run(void *cdata, int task_id) {
}
int TransposeCPUKernel::Run() {
MS_ASSERT(in_tensors_.size() == 2);
MS_ASSERT(out_tensors_.size() == 1);
auto &in_tensor = in_tensors_.front();
auto &out_tensor = out_tensors_.front();

Loading…
Cancel
Save