[caffe2] Do not run RemoveOpsByType on recurrent networks (#45986)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45986
Recurrent networks have subnets that are not well supported by `RemoveOpsByType`. Here we exclude recurrent networks by adding the same check as in memonger.
Test Plan:
```
buck test //caffe2/caffe2/fb/predictor:black_box_predictor_test
```
AdIndexer canary for sanity check:
https://www.internalfb.com/intern/ads/canary/430059485214766620
Differential Revision: D24167284
fbshipit-source-id: fa90d1c1f34af334a599d879af09d4c0bf7c27bd