标签:evel mode mod http lazy ssi 命令 类型 variable
import os
os.environ[‘TF_CPP_MIN_LOG_LEVEL‘] = ‘2‘
import tensorflow as tf
x = tf.constant([10,20,30,40])
# 定义变量
y = tf.Variable(initial_value=x*20+10)
# 修改命令空间
with tf.variable_scope(‘my_scope‘):
Z = tf.Variable(initial_value=100)
print(‘x:‘,x)
print(‘y:‘,y)
print(‘Z:‘,Z)
# 初始化变量
model = tf.global_variables_initializer()
# 开启会话
with tf.Session() as sess:
# 运行初始化变量
sess.run(model)
y_value = sess.run(y)
print(‘y_value:‘,y_value)
Z_value = sess.run(Z)
print(‘Z_value:‘,Z_value)
标签:evel mode mod http lazy ssi 命令 类型 variable
原文地址:https://www.cnblogs.com/monsterhy123/p/13088529.html