modify adapter format type

This commit is contained in:
changzherui 2021-09-06 21:27:20 +08:00
parent 1b4f0bd033
commit 9169c205bd
3 changed files with 8 additions and 3 deletions

View File

@ -306,7 +306,12 @@ std::string GetOpIOFormat(const AnfNodePtr &anf) {
if (iter->second == "format") { if (iter->second == "format") {
ValuePtr format = prim->GetAttr("format"); ValuePtr format = prim->GetAttr("format");
MS_EXCEPTION_IF_NULL(format); MS_EXCEPTION_IF_NULL(format);
return GetValue<std::string>(format); if (format->isa<Int64Imm>()) {
CheckAndConvertUtils::ConvertAttrValueToString(prim->name(), "format", &format);
return GetValue<std::string>(format);
} else {
return GetValue<std::string>(format);
}
} }
return iter->second; return iter->second;
} }

View File

@ -358,7 +358,7 @@ Parameters for learning rate:
### [Export MindIR](#contents) ### [Export MindIR](#contents)
```shell ```shell
python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT] python export.py --model_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT]
``` ```
The ckpt_file parameter is required, The ckpt_file parameter is required,

View File

@ -361,7 +361,7 @@ Parameters for learning rate:
### [导出MindIR](#contents) ### [导出MindIR](#contents)
```shell ```shell
python export.py --ckpt_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT] python export.py --model_file [CKPT_PATH] --file_name [FILE_NAME] --file_format [FILE_FORMAT]
``` ```
参数ckpt_file为必填项 参数ckpt_file为必填项