tensorflow 创建实例
import tensorflow as tf #导入tensorflow
constant = tf.constant([1, 5], dtype = tf.int64) #创建实例
print(constant) #打印实例
print(constant.dtype) #打印实例类型
print(constant.shape) #打印实例形状
下图所示为结果
tf.Tensor([1 5], shape=(2,), dtype=int64) #实例
<dtype: 'int64'> #实例类型
(2,) #有一个逗号隔开,说明为一维数组