with tf.compat.v1.Session() as sess用法详解

import tensorflow as tf
 
# Build a graph.
a = tf.constant([1.0, 2.0])
b = tf.constant([3.0, 4.0])
c = a * b
 
with tf.Session() as sess:
    print sess.run(c)

 

posted @ 2022-02-25 14:34  Tomorrow1126  阅读(762)  评论(0编辑  收藏  举报