[更新]TensorFlow – 函数学习

函数 参数 作用
tf.transpose x, [0,3,1,2] 转置,也就是交换维度
tf.expand_dims x, d 在d维增加一个维度
tf.gather x, [indices] 选取x中下标为[indices]的元素
tf.slice x, [begin], [size] 截取,相当于字符串或数组[begin:end]的作用
tf.concat [x1, x2, …], axis 连接, ([1],[2]) concat后为[1,2]
tf.stack [x1, x2, …], axis 堆叠, ([1],[2]) stack后为[[1],[2]]
tf.tile x, [size] 平铺,x的维度必须大于等于size的维度