fix for special case when dense dim is 1
fix for special case when dense dim is 1

Summary: otherwise it will fail here: https://fburl.com/puy5x2dq

Reviewed By: kittipatv

Differential Revision: D4719212

fbshipit-source-id: e0d8211f64dca00ee48df3235d2bc030ea30f208

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