forked from mindspore-Ecosystem/mindspore
benchmark mark accuracy use only 1 tensor
This commit is contained in:
parent
1e3f83ce50
commit
6bb057ea27
|
@ -234,17 +234,21 @@ int Benchmark::CompareOutput() {
|
||||||
MS_LOG(ERROR) << "Cannot find output node: " << nodeName.c_str() << " , compare output data fail.";
|
MS_LOG(ERROR) << "Cannot find output node: " << nodeName.c_str() << " , compare output data fail.";
|
||||||
return RET_ERROR;
|
return RET_ERROR;
|
||||||
}
|
}
|
||||||
for (auto tensor : tensors) {
|
// make sure tensor size is 1
|
||||||
MS_ASSERT(tensor->GetDataType() == DataType_DT_FLOAT);
|
if (tensors.size() != 1) {
|
||||||
MS_ASSERT(tensor->GetData() != nullptr);
|
MS_LOG(ERROR) << "Only support 1 tensor with a name now.";
|
||||||
float bias = CompareData(nodeName, tensor->shape(), static_cast<float *>(tensor->MutableData()));
|
return RET_ERROR;
|
||||||
if (bias >= 0) {
|
}
|
||||||
totalBias += bias;
|
auto &tensor = tensors.front();
|
||||||
totalSize++;
|
MS_ASSERT(tensor->GetDataType() == DataType_DT_FLOAT);
|
||||||
} else {
|
MS_ASSERT(tensor->GetData() != nullptr);
|
||||||
hasError = true;
|
float bias = CompareData(nodeName, tensor->shape(), static_cast<float *>(tensor->MutableData()));
|
||||||
break;
|
if (bias >= 0) {
|
||||||
}
|
totalBias += bias;
|
||||||
|
totalSize++;
|
||||||
|
} else {
|
||||||
|
hasError = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue