Data Science Asked by Contestosis on July 19, 2021
I have a tensor x
of shape (5, 1)
. I would like to stack 10 copies of it so that I get a tensor of shape (5, 10)
. In a sort, it would look like [x|..|x]
. How to do it the keras way? I have tried the Concatenate
layer, but I got an error.
Help is welcome!
After many troubles with Concatenate
, I simply did:
x = Reshape((5, 1))(x)
t = ones((1, 10))
stacked_x = x @ t
Maths help a lot. Should have thought about it earlier.
Answered by Contestosis on July 19, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP