add load_param_mem(), which load plain text params from memory buf. #579
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
虽然有load_param(const unsigned char*& mem),从内存加载 bin格式的params,但是bin格式,只能通过layer index 指定输入输出,不同模型的layer index 不一样,但通过plain text 格式的params,则可以定义特定的输入输出名字。
虽然有 fmemopen()函数可以将一块内存映射位FILE*,就可以套用load_param(FILE* fp), 但是fmemopen函数只能在Android6.0+上使用。
所以加了这两个函数,函数内容和load_param(FILE* fp);几乎一样,只是通过宏来更改位从内存字符串中sscanf数据。