Skip to content

Conversation

@jiangjiajun
Copy link
Contributor

@jiangjiajun jiangjiajun commented Nov 5, 2021

Add 4 operators, the first 3 operators support 4D tensor's interpolation, and flatten_contiguous_range is a operator just like torch.flatten.

  • nearest_interp_v2
  • bicubic_interp_v2
  • bilinear_interp_v2
  • flatten_contiguous_range

This pull request modified frontend/common.py::try_infer_value, while before this function will not take model's parameters to infer value. With this pull request, it will help to solve some dynamic shape problem, e.g x = op.reshape(x, shape=shape), if the shape is a parameter of the original model, the old try_infer_value will fail to infer its value.
While reviewing the code, I found try_infer_value was not called correctly in paddle frontend, although it didn't cause error because the execution is under try block, this also fixed in this pull request.

@mbrookhart @AndrewZhaoLuo @masahi

Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.

@jiangjiajun jiangjiajun changed the title [Frontend][PaddlePaddle] Add operators of interploate and flatten [Frontend][PaddlePaddle] Add operators of interploate/flatten and modify try_infer_value Nov 5, 2021
@masahi masahi merged commit a644e29 into apache:main Nov 8, 2021
mehrdadh pushed a commit to mehrdadh/tvm that referenced this pull request Dec 1, 2021
…ify try_infer_value (apache#9459)

* add interploate and flatten

* fix spells

* fix diff

* rename unit test name

* add parameters for common:try_infer_value

* eliminate unnecessary diff

* fix pylint problem

* fix pylint problem

* eliminate unnecessary diff
mehrdadh pushed a commit to mehrdadh/tvm that referenced this pull request Dec 1, 2021
…ify try_infer_value (apache#9459)

* add interploate and flatten

* fix spells

* fix diff

* rename unit test name

* add parameters for common:try_infer_value

* eliminate unnecessary diff

* fix pylint problem

* fix pylint problem

* eliminate unnecessary diff
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
…ify try_infer_value (apache#9459)

* add interploate and flatten

* fix spells

* fix diff

* rename unit test name

* add parameters for common:try_infer_value

* eliminate unnecessary diff

* fix pylint problem

* fix pylint problem

* eliminate unnecessary diff
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 11, 2022
…ify try_infer_value (apache#9459)

* add interploate and flatten

* fix spells

* fix diff

* rename unit test name

* add parameters for common:try_infer_value

* eliminate unnecessary diff

* fix pylint problem

* fix pylint problem

* eliminate unnecessary diff
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
…ify try_infer_value (apache#9459)

* add interploate and flatten

* fix spells

* fix diff

* rename unit test name

* add parameters for common:try_infer_value

* eliminate unnecessary diff

* fix pylint problem

* fix pylint problem

* eliminate unnecessary diff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants