import tensorflow as tf
import numpy as np
with tf.device("/device:CPU:0"):
“”"
此区域的代码会放在本机的第1个cpu上去执行
“”"
with tf.device("/device:GPU:0"):
“”"
此区域的代码会放在本机的第1个gpu上去执行
“”"
import tensorflow as tf
import numpy as np
with tf.device("/device:CPU:0"):
“”"
此区域的代码会放在本机的第1个cpu上去执行
“”"
with tf.device("/device:GPU:0"):
“”"
此区域的代码会放在本机的第1个gpu上去执行
“”"