forked from mindspore-Ecosystem/mindspore
!20158 fix codex issues 20210713 add "const" && fix snprintf_s
Merge pull request !20158 from ZeyangGAO/fixcodexbug
This commit is contained in:
commit
6e1a0ca95b
|
@ -101,8 +101,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -63,8 +63,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput = outputs[i].Data();
|
||||
|
|
|
@ -64,8 +64,8 @@ std::vector<std::string> GetImagesById(const std::string &idFile, const std::str
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -46,8 +46,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput = outputs[i].Data();
|
||||
|
|
|
@ -157,7 +157,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
average = average/infer_cnt;
|
||||
|
||||
snprintf(tmpCh, sizeof(tmpCh), "NN inference cost average time: %4.3f ms of infer_count %d\n", average, infer_cnt);
|
||||
snprintf_s(tmpCh, sizeof(tmpCh), "NN infer cost average time: %4.3f ms of infer_count %d\n", average, infer_cnt);
|
||||
std::cout << "NN inference cost average time: "<< average << "ms of infer_count " << infer_cnt << std::endl;
|
||||
std::string file_name = "./time_Result" + std::string("/test_perform_static.txt");
|
||||
std::ofstream file_stream(file_name.c_str(), std::ios::trunc);
|
||||
|
|
|
@ -63,8 +63,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -101,8 +101,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -45,8 +45,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -45,8 +45,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -45,8 +45,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -101,8 +101,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
|
@ -45,8 +45,8 @@ std::vector<std::string> GetAllFiles(std::string_view dirName) {
|
|||
|
||||
int WriteResult(const std::string& imageFile, const std::vector<MSTensor> &outputs) {
|
||||
std::string homePath = "./result_Files";
|
||||
int INVALID_POINTER = -1;
|
||||
int ERROR = -2;
|
||||
const int INVALID_POINTER = -1;
|
||||
const int ERROR = -2;
|
||||
for (size_t i = 0; i < outputs.size(); ++i) {
|
||||
size_t outputSize;
|
||||
std::shared_ptr<const void> netOutput;
|
||||
|
|
Loading…
Reference in New Issue