Section concept map

import tensorflow as tf 
import os

os.environ [ ' TF_CPP_MIN_LOG_LEVEL ' ] = ' 2 ' 
# modify TensorFlow warning level

# Create a map containing op and tensor, in the context of FIG environment 
# op: function as long as the API is defined TensorFlow op 
# Tensor: refer to data that 
G = tf.Graph ()

Print (G)
 # FIG 
with g.as_default ():
    c = tf.constant(11.0)
    print(c.graph)


# FIGS FIG interfere with each other and between 
A = tf.constant (5.0 )
b = tf.constant(6.0)

sum1 = tf.add(a, b)
Graph = tf.get_default_graph
 # View map objects are created by default Photo 
Print (Graph)

# The Session session, only operation a picture 
with tf.Session () AS sess:
     Print (sess.run (sum1))
     # output sum1
    
    print(a.graph)
    #

    print(sum1.graph)
    #

    print(sess.graph)
    # 

 

Guess you like

Origin www.cnblogs.com/kogmaw/p/12597596.html