Hi,
Is there a smart way to do: my_tensor.unsqueeze(0).unsqueeze(0)
in one shot?
something like my_tensor.unsqueeze(0,1)
It’s not a big deal but if you want to had 3 fake dimensions, the code line stops to look serious
Hi,
Is there a smart way to do: my_tensor.unsqueeze(0).unsqueeze(0)
in one shot?
something like my_tensor.unsqueeze(0,1)
It’s not a big deal but if you want to had 3 fake dimensions, the code line stops to look serious
How, just my_tensor.view(1,1,-1)
did it… ok sorry for the topic…
This flattens the -1 dimension
you can use my_tensor(*my_tensor.shape,1,1)