# -*- coding: utf-8 -*-
"""
Created on Tue Apr 20 20:32:26 2021
@author: LiMeng
"""
import tensorflow as tf
a = tf.constant([1,5],dtype = tf.int64) #创建一个一阶张量,里面有两个元素,1和5,数据类型是32位整型
print("a:",a)
print("a.dtype:",a.dtype)
print("a.shape:",a.shape)#打印出a的形状,a的形状看shape里面逗号隔开了几个数字,逗号隔开了几个数字,这个张量就是几维的
#本例中,shape(2,);逗号隔开了一个数字,说明是一维张量,数字是2,说明张量里有两个元素(即为数值1和5)。