I’ve been scratching my head on that, too. When you ask for foo’s type(), it reports LongTensor. Its type is indistinguishable when created the two different ways in my example code above, but one way works and one doesn’t.
print( "foo", foo, foo.type() )

it says
foo Variable containing:
 0
 0
 0
 1
 1
 1
[torch.LongTensor of size (6,1)]
 torch.LongTensor