https://iamarookie.blog.csdn.net/article/details/117755839
TensorFlow2 基本操作3
合并与分割
tf.concat
tf.concat...]
[0. 0. 0. 1. 1. 1.]], shape=(5, 6), dtype=float32)
tf.stack
rf.stack可以创建一个新的维度来合并两个张量....[1., 1., 1.],
[1., 1., 1.]]], dtype=float32)>]
数据统计
tf.norm
tf.norm可以帮助我们计算向量, 矩阵, 张量的范数...格式:
tf.norm(
tensor, ord='euclidean', axis=None, keepdims=None, name=None
)
参数:
tensor: 输入的张量-...ord: 范数的顺序- axis: 操作的维度- keep_dims: 如果为 True, 则 axis 中指定的轴将保持为大小 1- name: 数据名称 例子:
a = tf.fill([2, 2