提交 10225cbf 编写于 作者: L liuruilong

fix batch norm crash bug

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