提交 63fd571e 编写于 作者: L liuruilong

fix batch norm crash bug

上级 ed093b0b
......@@ -45,7 +45,6 @@ struct OperatorRegistrar : public Registrar {
<< "OperatorRegistrar should be invoked at least by OpClass";
return;
}
printf(" regis ting %s \n", op_type.c_str());
OpInfo<Dtype> info;
OperatorRegistrarRecursive<Dtype, 0, false, ARGS...>(op_type, &info);
OpInfoMap<Dtype>::Instance()->Insert(op_type, info);
......@@ -108,7 +107,6 @@ class OpRegistry {
__op_registrar_##op_type##_##device_name(#op_type); \
int TouchOpRegistrar_##op_type##_##device_name() { \
__op_registrar_##op_type##_##device_name.Touch(); \
printf(" registering !! \n"); \
return 0; \
}
......
......@@ -21,7 +21,6 @@ namespace paddle_mobile {
using framework::Variable;
static size_t ReadBuffer(const char *file_name, uint8_t **out) {
printf("%s \n", file_name);
FILE *fp;
fp = fopen(file_name, "rb");
PADDLE_MOBILE_ENFORCE(fp != NULL, " %s open failed !", file_name);
......
......@@ -229,7 +229,7 @@ void BatchnormCompute(const BatchNormParam &param) {
delete[] inv_std_ptr;
}
#endif
#else
float *inv_std_ptr = new float[C];
for (int i = 0; i < C; i++) {
inv_std_ptr[i] =
......@@ -260,6 +260,7 @@ void BatchnormCompute(const BatchNormParam &param) {
}
}
delete[] inv_std_ptr;
#endif
}
} // namespace operators
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册