Skip to content

Commit

Permalink
fix generator pickle for custom device (#55247)
Browse files Browse the repository at this point in the history
  • Loading branch information
YanhuiDua authored Jul 10, 2023
1 parent 31bf1e8 commit b20d22d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paddle/fluid/pybind/generator_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ void BindGenerator(py::module* m_ptr) {
[](std::shared_ptr<phi::Generator::GeneratorState>& self) {
return self->current_seed;
})
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) || \
defined(PADDLE_WITH_CUSTOM_DEVICE) || defined(PADDLE_WITH_XPU)
// NOTE(shenliang03): Due to the inability to serialize mt19937_64
// type, resulting in a problem with precision under the cpu.
.def(py::pickle(
Expand Down

0 comments on commit b20d22d

Please sign in to comment.