1.numpy转换成为tensor
tf.convert_to_tensor(np.ones([2,3]))
tf.convert_to_tensor([1,2])#shape=2
tf.convert_to_tensor([1],[2])#shape=2,1
2.tf.zero
tf.zero([])
numpy=0.0 shape=() 标量
tf.zero([1])
numpy=[0.] shape=(1,)
tf.zero([2,2])
numpy=[[0,0 ],[0,0]] shape=(2,2)
a=tf.zero([2,3,3])
tf.zeros_like(a)
tf.zeros(a.shape)
3.tf.ones
4.tf.fill
tf.fill([2,2],3)
5.normal
1.正态分布
2.均匀分布
6.tf.constant([1,2],[3,4])
注意前后的维度要一样