Fix potential GPU transform OOB access
Fix potential GPU transform OOB access

Summary:
Occurred when running with multiple GPUs, not all of which
are connected via P2P.

Essentially when mean_gpu_ and std_gpu_ are allocated and
populated in the constructor of ImageInputOp, it does not seem to
be guaranteed that the active context is the same as the final context
on which the Op will be run. This causes the image data and the
mean/std to be on different devices. With P2P we don't mind this, but
without this causes OOB memory accesses in the GPU transform
kernel.
Closes https://github.com/caffe2/caffe2/pull/802

Differential Revision: D5258528

Pulled By: akyrola

fbshipit-source-id: 778e55b5f8bb39fc52644b68573c747210ebf3bb

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