0
点赞
收藏
分享

微信扫一扫

tf.eye

云竹文斋 2023-01-16 阅读 184


tf.eye(2)

<tf.Tensor: shape=(2, 2), dtype=float32, numpy=
array([[1., 0.],
[0., 1.]], dtype=float32)>

tf.eye(2, batch_shape=[3])

<tf.Tensor: shape=(3, 2, 2), dtype=float32, numpy=
array([[[1., 0.],
[0., 1.]],

[[1., 0.],
[0., 1.]],

[[1., 0.],
[0., 1.]]], dtype=float32)>

tf.eye(2, num_columns=3)

<tf.Tensor: shape=(2, 3), dtype=float32, numpy=
array([[1., 0., 0.],
[0., 1., 0.]], dtype=float32)>


举报

相关推荐

0 条评论