tensrflow.device(设备空间)

import tensorflow as tf
import numpy as np

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

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

猜你喜欢

转载自blog.csdn.net/qq_33345917/article/details/84993196