dachte icon

test_cuda.py

dachte | PRO | 01/29/23 08:13:42 PM UTC | 0 ⭐ | 970 👁️ | Never ⏰ | []
Python |

330 B

|

None

|

0 👍

/

0 👎

#!/usr/bin/env python
  
import tensorflow as tf
 
from tensorflow.python.client import device_lib
print(str(device_lib.list_local_devices() ))
 
m1 = tf.constant([[1.0, 2.0]])
m2 = tf.constant([[3.0], [4.0]])
product = tf.matmul(m1, m2)
 
with tf.Session() as session:
        result = session.run(product)
 
print(result)

Comments