Hello world!!
I have a question. I have this command in tf tf.tile(tf.expand_dims(inputs, 0), [K, 1, 1])
but I need the output in pytorch type. How can I write this expression in torch way or how to convert the result to torch?
Thanks.
Hello world!!
I have a question. I have this command in tf tf.tile(tf.expand_dims(inputs, 0), [K, 1, 1])
but I need the output in pytorch type. How can I write this expression in torch way or how to convert the result to torch?
Thanks.
the equivalent pytorch expression would be:
inputs.unsqueeze(dim=0).repeat(K, 1, 1)
As an alternative way, If you want to convert the tensorflow result to pytorch, depending on tensorflow version, you can either call .eval()
(< tf 2.0) or .numpy()
(>=tf 2.0) on the tensorflow result.