Reputation: 21
Based on tensorflow functions. There is a tensor A=[1 10 5 6]. How could I create a tensor B which looks like the following:
[[[1 1 1 ],[1 1 1 ],[1 1 1 ]],
[[10 10 10],[10 10 10],[10 10 10]],
[[5 5 5 ],[5 5 5 ],[5 5 5 ]],
[[6 6 6 ],[6 6 6 ],[6 6 6 ]]]
Thanks.
Upvotes: 0
Views: 456
Reputation: 21
A_reshape = tf.expand_dims(A,1)
A_reshape = tf.expand_dims(A_reshape,2)
B = tf.tile(A_reshape, [1,3,3])
Upvotes: 1