faster sparse lengths weighted sum
faster sparse lengths weighted sum

Summary: following optimization in sparse lengths sum, translate it into weightedsum

Reviewed By: azzolini

Differential Revision: D5732859

fbshipit-source-id: 430ee077a1063f3c55806f6dbb5ea46f0fd5c486

xzturn/caffe2,sf-wind/caffe2,pietern/caffe2,sf-wind/caffe2,Yangqing/caffe2,xzturn/caffe2,pietern/caffe2,Yangqing/caffe2,Yangqing/caffe2,xzturn/caffe2,pietern/caffe2,davinwang/caffe2,davinwang/caffe2,sf-wind/caffe2,Yangqing/caffe2,xzturn/caffe2,pietern/caffe2,Yangqing/caffe2,davinwang/caffe2,sf-wind/caffe2,xzturn/caffe2,davinwang/caffe2,davinwang/caffe2,sf-wind/caffe2,pietern/caffe2,caffe2/caffe2