Solved by KFrank in post #2 
              
              
                Hi Kof! 

I would not use a tensor of length 8 and attempt to constrain its first 
half to mirror its second.  Just use a tensor of length 4, and use each 
of its 4 elements twice in your computations. 
Here is an example: 
>>> import torch
>>> torch.__version__
'1.7.1'
>>> T = torch.randn (4, requi…