Add rule based filtering for ONNXIFI transformation (#17198)
authorYinghai Lu <yinghai@fb.com>
Wed, 20 Feb 2019 20:37:34 +0000 (12:37 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 20 Feb 2019 20:47:24 +0000 (12:47 -0800)
commitdb1d61a5c3f80a5b05ec861ea59b638130355a48
treeb598750ea3018bb91a2ecfffaed89e62331ea767
parent63214b572b6a18f7328687ca69420f0be0eaaaa9
Add rule based filtering for ONNXIFI transformation (#17198)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17198

We come to the point that we need to apply some rules to bind certain ops together to avoid un-inferrable intermediate shapes. We either lower them together to backend or neither. This diff adds a pass for us to add rules like this. The first one is to bind `Gather` with `SparseLengthsWeighted*`.

Reviewed By: ipiszy

Differential Revision: D14118326

fbshipit-source-id: 14bc62e1feddae02a3dd8eae93b8f553d52ac951
caffe2/onnx/onnxifi_graph_info.h
caffe2/operators/onnxifi_op.h
caffe2/opt/backend_transformer_base.cc
caffe2/opt/backend_transformer_base.h
caffe2/opt/onnxifi_transformer.cc
caffe2/opt/onnxifi_transformer.h