WARNING:tensorflow:From <ipython-input-7-17bb7203622b>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
True
with tf.device('cpu'):
a = tf.constant([1])with tf.device('gpu'):
b = tf.range(4)print(a.device)print(b.device)
aa = a.gpu()print(aa.device)
bb = b.cpu()print(bb.device)
/job:localhost/replica:0/task:0/device:CPU:0
/job:localhost/replica:0/task:0/device:GPU:0
WARNING:tensorflow:From <ipython-input-9-b0029145c942>:9: _EagerTensorBase.gpu (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.identity instead.
/job:localhost/replica:0/task:0/device:GPU:0
WARNING:tensorflow:From <ipython-input-9-b0029145c942>:12: _EagerTensorBase.cpu (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.identity instead.
/job:localhost/replica:0/task:0/device:CPU:0