sorry , is it your full code?
I tried this , but got some error else.
in this line:
 for i in a :
     i.unsqueeze_(dim=0)

I got the error:
      1 for i in a:
----> 2     i.unsqueeze_(dim=0)
      3     print(type(i))
      4

AttributeError: 'int' object has no attribute 'unsqueeze_'

I also think  i is just a ‘int’, and can’t unsqueeze_()
Maybe you just post part of your code?