tensorflow 1

import tensorflow as tf
# print('haha')
# a = tf.add(2,3)
# print(a)
# sess = tf.Session()
# print(sess.run(a))
# sess.close()
# x = 2
# y = 3
# op1 = tf.add(x,y)
# op2 = tf.multiply(x,y)
# op3 = tf.pow(op2,op1)
# with tf.Session() as sess1:
# op3 =sess1.run(op3)
# print(op3)
#lx2
# g = tf.Graph()
# with g.as_default():
# x = tf.add(3,5)
# sess2 = tf.Session(graph=g)
# with tf.Session() as sess2:
# sess2.run(x)
# my_const = tf.constant([1.0,2.0],name='my_const')
# with tf.Session() as sess:
# print(sess.graph.as_graph_def())
#a = tf.constant(2)#定义常量
#tf.fill([2,3],8)#==>[[8,8,8],[8,8,8]]创建二行三例的矩阵
#tf.linspace(start,stop,num,name=None)
#tf.linespace(10.0,13.0,4)==>[10.0,11.0,12.0,13.0]
#tf.range(start,limit=None,delta=1,dtype=None,name='range')
#'start' is 3,'limit' is 18,'delta' is 3
#tf.range(start,limit,delta)=>[3,6,9,12,15]
#limit is 5
#tf.range(limit) ==> [0,1,2,3,4]


 


原文地址:https://www.cnblogs.com/rongye/p/9997863.html