提交 2a5fcc8b 编写于 作者: Z zhaojiaying01

fix loadWhenPredict option in PaddleMobileCPUConfig

上级 9761e72c
...@@ -44,6 +44,11 @@ ...@@ -44,6 +44,11 @@
*/ */
@property (assign, nonatomic) BOOL optimize; @property (assign, nonatomic) BOOL optimize;
/**
@b 是否预测时初始化内存,用于处理可变输入
*/
@property (assign, nonatomic) BOOL loadWhenPredict;
@end @end
@interface PaddleMobileCPU : NSObject @interface PaddleMobileCPU : NSObject
......
...@@ -73,6 +73,8 @@ static std::mutex shared_mutex; ...@@ -73,6 +73,8 @@ static std::mutex shared_mutex;
- (instancetype)initWithConfig:(PaddleMobileCPUConfig *)config { - (instancetype)initWithConfig:(PaddleMobileCPUConfig *)config {
if (self = [super init]) { if (self = [super init]) {
paddle_mobile::PaddleMobileConfigInternal configInternal;
configInternal.load_when_predict = config.loadWhenPredict;
pam_ = new paddle_mobile::PaddleMobile<paddle_mobile::CPU, float>(); pam_ = new paddle_mobile::PaddleMobile<paddle_mobile::CPU, float>();
_config = config; _config = config;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册