https://github.com/BVLC/caffe/pull/1667