一、张量定义
1、常量
tf.constant()
tf.linspace()
tf.range()
tf.fill()
tf.eye()
tf.diag()
tf.ones();tf.ones_like()
tf.zeros();tf.zeros_like()
2、随机数
tf.random_normal()
tf.truncated_normal()
tf.random_shuffle()
tf.random_uniform()
3、形状操作
tf.shape()=>list
tf.size()=>int
tf.reshape()
tf.rank()=>size(shape())=>int
tf.expand_dims(a,dim)在dim前插入1维
tf.squeeze()压缩其中的1维
tf.splice()
tf.split()
tf.reverse()
tf.transpose()
tf.pack()
tf.concat()
二、运算符
1、算术运算符
tf.matmul()
tf.add()
tf.subtract()
tf.multiply()
tf.divide()
tf.square()
tf.sqrt()
tf.power()
tf.exp()
tf.log()
tf.sin cos tan atan
tf.sign()
tf.inv()
tf.mod()
tf.abs()
tf.negative()
tf.round ceil floor
TensorFlow篇——定义张量、运算符
最新推荐文章于 2023-03-01 14:52:37 发布