Hi,
I have a dimention=4 Variable out which has the size (100L,64L,32L,32L).
When selecting the second dimension out[:, i, :, :], the shape become (100L, 32L, 32L).
How could I keep the selected dimension as (100L, 1L, 32L, 32L)?
Thanks,
Hi,
I have a dimention=4 Variable out which has the size (100L,64L,32L,32L).
When selecting the second dimension out[:, i, :, :], the shape become (100L, 32L, 32L).
How could I keep the selected dimension as (100L, 1L, 32L, 32L)?
Thanks,
Use out[:, i:i+1, :, :] instead.
out.narrow(1, i, 1)
might be slightly cleaner.