asyml / texar-pytorch

Integrating the Best of TF into PyTorch, for Machine Learning, Natural Language Processing, and Text Generation. This is part of the CASL project: http://casl-project.ai/
https://asyml.io
Apache License 2.0
745 stars 117 forks source link

Compatibility update with numpy>=1.20 #333

Closed hunterhector closed 2 years ago

hunterhector commented 3 years ago

Numpy has made a big release of version 1.20.0. Texar is not fully tested with the new release. One particular problem is the newly introduced type annotations for Numpy functions. This change will at least make mypy raise type errors.

To update to the new numpy version, the mypy-raised errors should be reviewed and fixed accordingly.

To get the list of typing errors, run mypy . with numpy >=1.20, or check the previously workflow log: https://github.com/asyml/texar-pytorch/runs/2197557226?check_suite_focus=true

tanyuqian commented 2 years ago

A workflow enumerating numpy versions can be found here.

There are ~20 linting errors with in mypy test. numpy 1.20 errors, numpy 1.21 erros.

Plus, the change of numpy version doesn't influence the code logic. mypy linting is the only place to fix. (the workflow without mypy works well).