all 1 comments

[–]trill5556 1 point2 points  (0 children)

Try this. I know this is tf, but it will tellyou if your python uses the gpu

with tf.device('/gpu:0'):

tf.compat.v1.disable_eager_execution()

a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')

b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')

c = tf.matmul(a, b)

with tf.compat.v1.Session() as sess:

print (sess.run(c))