I've been trying to use GPU with tensorflow on Colaboratory, but when I do
a = tf.constant(np.random.rand(1000,20000))
b = tf.constant(np.random.rand(20000,1000))
with tf.device('/device:GPU:0'):
c_gpu = tf.matmul(a,b)
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
print(sess.run(c_gpu))
the devices of the operations are not printed, although the result of the operation is. I suspect it is not using the GPU because I had measured the times of the matrix multiplication for both GPU and CPU and compared them.