[trainers] fixed the moving of the model to CPU when generating images

2 jobs for 4-add-gans in 10 minutes and 20 seconds (queued for 6 seconds)
Status Job ID Name Coverage
  Build
passed #145132
docker
build_linux_27

00:10:20

78.0%
passed #145133
docker
build_linux_36

00:08:38

78.0%