interpolate (#14123)
authorElias Ellison <eellison@fb.com>
Tue, 4 Dec 2018 07:59:36 +0000 (23:59 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 4 Dec 2018 08:01:43 +0000 (00:01 -0800)
commit862b8cae51321a16936d87567e8a455186ca2d85
tree04e013e60247bfde49dcd47403f3573b7384a559
parenta23863fd6fc40db28367bfc072dc17715c991d83
interpolate (#14123)

Summary:
Add support for interpolate and upsampling in weak_script mode.

Because the function parameters are overloaded, i had to add it as a builtin op. For interpolate:
size can be ?int | int[]?, and scale_factor can be ?float | float[]?. Every combination of the two parameters needs to be supported.

The same logic applies for upsample_nearest, upsample_bilinear, and upsample.

There are a few fixes that I came to along the way.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14123

Differential Revision: D13278923

Pulled By: eellison

fbshipit-source-id: e59729034369be4ce4b747291a3d1c74e135b869
test/common_nn.py
test/test_jit.py
torch/csrc/jit/operator.cpp
torch/csrc/jit/register_prim_ops.cpp
torch/jit/__init__.py
torch/nn/modules/upsampling.py