未验证 提交 e864667b 编写于 作者: C chentianyu03 提交者: GitHub

fix using boost::none as the init value when using paddle::optional (#35215)

上级 ca4d2fca
...@@ -113,7 +113,7 @@ struct BuildStrategy { ...@@ -113,7 +113,7 @@ struct BuildStrategy {
// Fuse_all_optimizer_ops and fuse_all_reduce_ops require that gradients // Fuse_all_optimizer_ops and fuse_all_reduce_ops require that gradients
// should not be sparse types // should not be sparse types
paddle::optional<bool> fuse_all_optimizer_ops_{false}; paddle::optional<bool> fuse_all_optimizer_ops_{false};
paddle::optional<bool> fuse_all_reduce_ops_{boost::none}; paddle::optional<bool> fuse_all_reduce_ops_{paddle::none};
// fuse_relu_depthwise_conv can fuse the `relu -> // fuse_relu_depthwise_conv can fuse the `relu ->
// depthwise_conv` // depthwise_conv`
bool fuse_relu_depthwise_conv_{false}; bool fuse_relu_depthwise_conv_{false};
...@@ -121,7 +121,7 @@ struct BuildStrategy { ...@@ -121,7 +121,7 @@ struct BuildStrategy {
// faster. Because fusing broadcast OP equals delaying the execution of all // faster. Because fusing broadcast OP equals delaying the execution of all
// broadcast Ops, in this case, all nccl streams are used only for reduce // broadcast Ops, in this case, all nccl streams are used only for reduce
// operations for a period of time. // operations for a period of time.
paddle::optional<bool> fuse_broadcast_ops_{boost::none}; paddle::optional<bool> fuse_broadcast_ops_{paddle::none};
// replace batch_norm with sync_batch_norm. // replace batch_norm with sync_batch_norm.
bool sync_batch_norm_{false}; bool sync_batch_norm_{false};
...@@ -135,7 +135,7 @@ struct BuildStrategy { ...@@ -135,7 +135,7 @@ struct BuildStrategy {
// By default, memory_optimize would be opened if gc is disabled, and // By default, memory_optimize would be opened if gc is disabled, and
// be closed if gc is enabled. // be closed if gc is enabled.
// Users can forcely enable/disable memory_optimize by setting True/False. // Users can forcely enable/disable memory_optimize by setting True/False.
paddle::optional<bool> memory_optimize_{boost::none}; paddle::optional<bool> memory_optimize_{paddle::none};
// Turn on inplace by default. // Turn on inplace by default.
bool enable_inplace_{true}; bool enable_inplace_{true};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册