提交 bc7be2aa 编写于 作者: Q qijun

pass precommit

上级 db4d668f
......@@ -159,19 +159,18 @@ All parameter, weight, gradient are variables in Paddle.
.def_static("create",
[](paddle::platform::CPUPlace& place)
-> paddle::platform::DeviceContext* {
return new paddle::platform::CPUDeviceContext();
})
return new paddle::platform::CPUDeviceContext();
})
.def_static(
"create",
[](paddle::platform::GPUPlace& place)
-> paddle::platform::DeviceContext* {
#ifdef PADDLE_ONLY_CPU
PADDLE_THROW("'GPUPlace' is not supported in CPU only device.");
PADDLE_THROW("'GPUPlace' is not supported in CPU only device.");
#else
return new paddle::platform::CUDADeviceContext(place);
return new paddle::platform::CUDADeviceContext(place);
#endif
});
});
py::class_<paddle::platform::GPUPlace>(m, "GPUPlace").def(py::init<int>());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册