You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by zh...@apache.org on 2022/12/02 04:51:53 UTC
[singa] branch dev updated: Switch between CPU and GPU devices for cnn example
This is an automated email from the ASF dual-hosted git repository.
zhaojing pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/singa.git
The following commit(s) were added to refs/heads/dev by this push:
new f9ef8cdd Switch between CPU and GPU devices for cnn example
new 2c8b80be Merge pull request #1014 from zlheui/update-switch-gpu-cpu
f9ef8cdd is described below
commit f9ef8cdd02706adf97c834e33e125d2f021f52f3
Author: zhulei <zl...@gmail.com>
AuthorDate: Fri Dec 2 12:09:05 2022 +0800
Switch between CPU and GPU devices for cnn example
---
examples/cnn/train_cnn.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/cnn/train_cnn.py b/examples/cnn/train_cnn.py
index 28b092e8..20d5c444 100644
--- a/examples/cnn/train_cnn.py
+++ b/examples/cnn/train_cnn.py
@@ -107,7 +107,7 @@ def run(global_rank,
dist_option='plain',
spars=None,
precision='float32'):
- dev = device.create_cuda_gpu_on(local_rank)
+ dev = device.create_cuda_gpu_on(local_rank) # need to change to CPU device for CPU-only machines
dev.SetRandSeed(0)
np.random.seed(0)