Fix stepworkspace sizing
Fix stepworkspace sizing

Summary: When forward-only mode, we need only 2 workspaces. Errornously we sized the length of the workspace vector to 2 if it was different than 2. But if it was longer (because the step workspaces was shared by an non-forward-only op), we end up deleting the workspaces. With RNN Executor, this is a problem, because it held a reference to the deleted workspaces. Without RNN executor, we just ended recrearing the nets.

Reviewed By: jhcross

Differential Revision: D5654534

fbshipit-source-id: 1e6276e63453831747fee6a85c5057f01b89fde5

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