Bound shape inference for c2 (#16081)
authorYinghai Lu <yinghai@fb.com>
Thu, 17 Jan 2019 02:58:08 +0000 (18:58 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 17 Jan 2019 03:02:56 +0000 (19:02 -0800)
commit57d29ffa9cbce23b4dbfb5261b926bbb1d75944f
tree5d4003430eb0f9775d11b22657a236eb7f913289
parent7a5f782c2edfc744739fe992cf30877dff38462b
Bound shape inference for c2 (#16081)

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

A simple version of bound shape inference, conditioned on batch size. In addition to doing normal shape inference, it will change the batch size (1st dim of the shape) of the inputs as well as batch size modulating ops such as `SparseLengthsSum`. Probably support to more ops is needed, such as `SparseToDense`. We can build on this.

Reviewed By: jackm321, rdzhabarov

Differential Revision: D13661968

fbshipit-source-id: 6a724a647e109757c26e3e26e15a49725ecc75cc
caffe2/opt/bound_shape_inference_test.cc [new file with mode: 0644]
caffe2/opt/bound_shape_inferencer.cc [new file with mode: 0644]
caffe2/opt/bound_shape_inferencer.h [new file with mode: 0644]