tensorflow basic data type 1

import tensorflow as tf
# 定义一个常量
data1 = tf.constant(2.5)

# 定义一个变量
data2 = tf.Variable(10, name="var")

#打印数据的描述信息 
print(data1)
print(data2)

The output information is as follows

Tensor("Const_2:0", shape=(), dtype=float32)
<tf.Variable 'var_1:0' shape=() dtype=int32_ref>

Published 92 original articles · Likes5 · Visitors 10,000+

Guess you like

Origin blog.csdn.net/xfb1989/article/details/105429672