Solved by Matej_Kompanek in post #6 
              
              
                I tried implementing AVX version. On my PC it runs 3 times faster 
Duration symsum_avx: 0.127393 s 
Duration symsum_forward_unoptimized: 0.370589 s 
EDIT: changed loading and storing to unaligned versions as suggested 
here’s the code, if you’re interested 
torch::Tensor symsum_avx(torch::Tensor inp…