[C2] Fix the check of current scope in optimizer (#2316)
[C2] Fix the check of current scope in optimizer (#2316)

scope.CurrentDeviceScope() can return a None type, which was not considered.
xzturn/caffe2,caffe2/caffe2,xzturn/caffe2,xzturn/caffe2,xzturn/caffe2,xzturn/caffe2