sorry， i  am wrong about the dimension of x[x<0].  When i x is 2D, x[x<0] seems to be  one dimension.
>>> x = torch.randn(2,2)
>>> x.shape
(2L, 2L)
>>> x[x<0]

-1.9025
-0.2359
-0.3980
[torch.FloatTensor of size 3]

>>> x[x<0].shape
(3L,)
>>> x[x<0].size()
(3L,)
>>> x[x<0]

-1.9025
-0.2359
-0.3980
[torch.FloatTensor of size 3]

>>> x[x<0].size()
(3L,)

i’m just curious ahout how to implement assignment for bool index tensor. Please pull it up.