tf.broadcast_to

import tensorflow as tf
x = tf.constant([1, 2, 3])
y = tf.broadcast_to(x, [5, 3])
print(y)

tf.Tensor(
[[1 2 3]
 [1 2 3]
 [1 2 3]
 [1 2 3]
 [1 2 3]], shape=(5, 3), dtype=int32)
posted @ 2022-08-19 22:49  luoganttcc  阅读(7)  评论(0)    收藏  举报