未验证 提交 d8690564 编写于 作者: W Wang Xin 提交者: GitHub

fix braced-scalar-init warnings on macos (#47309)

上级 6f5e7826
......@@ -214,8 +214,9 @@ if(APPLE)
CACHE STRING "Build architectures for OSX" FORCE)
endif()
# On Mac OS X register class specifier is deprecated and will cause warning error on latest clang 10.0
set(COMMON_FLAGS -Wno-deprecated-register -Werror=format
-Werror=inconsistent-missing-override)
set(COMMON_FLAGS
-Wno-deprecated-register -Werror=format
-Werror=inconsistent-missing-override -Werror=braced-scalar-init)
endif()
if(WITH_HETERPS AND WITH_PSLIB)
......
......@@ -82,7 +82,7 @@ TEST(EagerUtils, AutoGradMeta) {
CHECK_NOTNULL(grad_node0.get());
EagerUtils::SetHistory(autograd_meta1, test_node);
EagerUtils::SetHistory({autograd_meta1}, test_node);
EagerUtils::SetHistory(autograd_meta1, test_node);
std::shared_ptr<GradNodeBase> grad_node1 = EagerUtils::grad_node(et1);
CHECK_NOTNULL(grad_node1.get());
......
......@@ -347,7 +347,7 @@ void BuildDygraphPhiKernelContext(const phi::KernelSignature& kernel_signature,
auto iter = outs.find(output_names[i]);
if (iter == outs.end()) {
kernel_ctx->EmplaceBackOutputWithoutSetRange({nullptr});
kernel_ctx->EmplaceBackOutputWithoutSetRange(nullptr);
kernel_ctx->AssignOutputRange(std::make_pair(start_idx, start_idx + 1),
i);
continue;
......@@ -358,7 +358,7 @@ void BuildDygraphPhiKernelContext(const phi::KernelSignature& kernel_signature,
for (size_t offset = 0; offset < outs_vector.size(); ++offset) {
if (outs_vector[offset] == nullptr) {
kernel_ctx->EmplaceBackOutputWithoutSetRange({nullptr});
kernel_ctx->EmplaceBackOutputWithoutSetRange(nullptr);
continue;
}
......
......@@ -26,10 +26,10 @@ KernelSignature ConcatOpArgumentMapping(const ArgumentMappingContext& ctx) {
KernelSignature ConcatGradOpArgumentMapping(const ArgumentMappingContext& ctx) {
if (ctx.HasInput("AxisTensor")) {
return KernelSignature(
"concat_grad", {"X", {"Out@GRAD"}}, {"AxisTensor"}, {{"X@GRAD"}});
"concat_grad", {"X", "Out@GRAD"}, {"AxisTensor"}, {"X@GRAD"});
}
return KernelSignature(
"concat_grad", {"X", {"Out@GRAD"}}, {"axis"}, {{"X@GRAD"}});
"concat_grad", {"X", "Out@GRAD"}, {"axis"}, {"X@GRAD"});
}
} // namespace phi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册