I have no idea, I have only ever used pytorch 0.3+.
That said tensor_vec.sum() should output a single scalar value, so you shouldn’t get an inconsistent tensor size error unless either I have misunderstood what your code does or pytorch 0.1.12 has a bug.