tf.broadcast_to()

tf.broadcast_to()

tf.broadcast_to()
将原始矩阵成倍增加
参数:

tf.broadcast_to(
    input,
    shape,
    name=None
)

使用案例:

import tensorflow as tf

a = [[1, 2, 3], [4, 5, 6]]
b = [4, 6]
sess = tf.Session()
print(sess.run(tf.broadcast_to(a, b)))#[[1 2 3 1 2 3]
 										[4 5 6 4 5 6]
										[1 2 3 1 2 3]
 										[4 5 6 4 5 6]]

你可能感兴趣的:(TensorFlow)