提交 ddf82d0e 编写于 作者: F frankwhzhang

fix error message, test=develop

上级 a7197bfb
...@@ -381,7 +381,8 @@ class BatchNormKernel<platform::CPUDeviceContext, T> ...@@ -381,7 +381,8 @@ class BatchNormKernel<platform::CPUDeviceContext, T>
break; break;
} }
default: default:
PADDLE_THROW("Unknown storage order: %s", data_layout_str); PADDLE_THROW(platform::errors::InvalidArgument(
"Unknown storage order: %s", data_layout_str));
} }
// if MomentumTensor is set, use MomentumTensor value, momentum // if MomentumTensor is set, use MomentumTensor value, momentum
...@@ -446,7 +447,8 @@ class BatchNormKernel<platform::CPUDeviceContext, T> ...@@ -446,7 +447,8 @@ class BatchNormKernel<platform::CPUDeviceContext, T>
break; break;
} }
default: default:
PADDLE_THROW("Unknown storage order: %d", data_layout); PADDLE_THROW(platform::errors::InvalidArgument(
"Unknown storage order: %d", data_layout));
} }
} }
}; };
...@@ -799,7 +801,8 @@ class BatchNormGradKernel<platform::CPUDeviceContext, T> ...@@ -799,7 +801,8 @@ class BatchNormGradKernel<platform::CPUDeviceContext, T>
break; break;
} }
default: default:
PADDLE_THROW("Unknown storage order: %s", data_layout_str); PADDLE_THROW(platform::errors::InvalidArgument(
"Unknown storage order: %s", data_layout_str));
} }
} }
}; };
......
...@@ -108,7 +108,8 @@ void FlListenAndServOp::RunSyncLoop(framework::Executor *executor, ...@@ -108,7 +108,8 @@ void FlListenAndServOp::RunSyncLoop(framework::Executor *executor,
auto optimize_blocks = auto optimize_blocks =
Attr<std::vector<framework::BlockDesc *>>(kOptimizeBlocks); Attr<std::vector<framework::BlockDesc *>>(kOptimizeBlocks);
PADDLE_ENFORCE_GE(num_blocks, 2, PADDLE_ENFORCE_GE(num_blocks, 2,
"server program should have at least 2 blocks"); platform::errors::InvalidArgument(
"server program should have at least 2 blocks"));
// Prepare all the server block // Prepare all the server block
std::vector<int> optimize_blocks_list; std::vector<int> optimize_blocks_list;
...@@ -192,7 +193,8 @@ void FlListenAndServOp::RunImpl(const framework::Scope &scope, ...@@ -192,7 +193,8 @@ void FlListenAndServOp::RunImpl(const framework::Scope &scope,
auto fan_in = Attr<int>("Fanin"); auto fan_in = Attr<int>("Fanin");
auto inputs = Inputs("X"); auto inputs = Inputs("X");
PADDLE_ENFORCE_EQ(!rpc_service_, true, "rpc_service_ must null"); PADDLE_ENFORCE_EQ(!rpc_service_, true, platform::errors::InvalidArgument(
"rpc_service_ must null"));
std::string endpoint = Attr<std::string>("endpoint"); std::string endpoint = Attr<std::string>("endpoint");
VLOG(4) << "sync_mode:" << sync_mode << ", fan_in:" << fan_in VLOG(4) << "sync_mode:" << sync_mode << ", fan_in:" << fan_in
...@@ -215,7 +217,8 @@ void FlListenAndServOp::RunImpl(const framework::Scope &scope, ...@@ -215,7 +217,8 @@ void FlListenAndServOp::RunImpl(const framework::Scope &scope,
Attr<std::vector<framework::BlockDesc *>>(kOptimizeBlocks); Attr<std::vector<framework::BlockDesc *>>(kOptimizeBlocks);
PADDLE_ENFORCE_GE( PADDLE_ENFORCE_GE(
optimize_blocks.size(), 1, optimize_blocks.size(), 1,
"optimize blocks should be 1 at least on the pserver side."); platform::errors::InvalidArgument(
"optimize blocks should be 1 at least on the pserver side."));
auto *program = optimize_blocks[0]->Program(); auto *program = optimize_blocks[0]->Program();
framework::Executor executor(dev_place); framework::Executor executor(dev_place);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册