Fix gelu in PyTorch frontend, tighten numerical checks (#5763)
authorThomas Viehmann <tv.code@beamnet.de>
Thu, 11 Jun 2020 12:10:27 +0000 (14:10 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Jun 2020 12:10:27 +0000 (21:10 +0900)
commit672e6cdd2ed21773d761d24f711902bded8b3d96
tree11d286ec5d12ab70e8d8d6ca1f883d1d37e108c5
parente2fb5039a2472403f2f6dfd65ac6b94de6758271
Fix gelu in PyTorch frontend, tighten numerical checks (#5763)

Previously, the PyTorch frontend approximated gelu with fastgelu.
To provide a more faithful conversion, we implement gelu instead.

We also tighten the numerical comparisons between PyTorch and
TVM-from-PyTorch to 1e-5. The object detection models need an
increased tolerance of 1e-4 to pass.

I had to throw in a few fixes for missing conversions
(probably due to working with very new PyTorch).

I must admit the GoogLeNet/NasNet test didn't run on my machine,
probably due to problems at my end.
python/tvm/relay/frontend/pytorch.py
tests/python/frontend/pytorch/test_forward.py