Skip to content

Fix type annotations for torch.sparse, enable in CI#43108

Closed
rgommers wants to merge 2 commits intopytorch:masterfrom
rgommers:ann-sparse
Closed

Fix type annotations for torch.sparse, enable in CI#43108
rgommers wants to merge 2 commits intopytorch:masterfrom
rgommers:ann-sparse

Conversation

@rgommers
Copy link
Copy Markdown
Collaborator

Closes gh-42982

@rgommers rgommers added the module: typing Related to mypy type annotations label Aug 15, 2020
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Aug 15, 2020

💊 CI failures summary and remediations

As of commit 88c5998 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 9 times.

Failure with the correct type annotation was:

```
E           RuntimeError:
E           Unknown type constructor Union:
E             File "/home/rgommers/code/pytorch/torch/sparse/__init__.py", line 86
E           def sum(input: Tensor, dim: Optional[Union[int, Tuple[int], List[int]]] = None,
E                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
E                   dtype: Optional[DType] = None) -> Tensor:
E               r"""
E           'sum' is being compiled since it was called from 'test_sparse_sum'
E             File "<string>", line 2
E           def test_sparse_sum(input):
E               return torch.sparse.sum(input)
```
@rgommers rgommers requested review from ezyang and malfet August 16, 2020 00:46
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@ezyang merged this pull request in 864f0cf.

@rgommers rgommers deleted the ann-sparse branch August 18, 2020 09:27
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Closes pytorchgh-42982

Pull Request resolved: pytorch#43108

Reviewed By: malfet

Differential Revision: D23167560

Pulled By: ezyang

fbshipit-source-id: 0d660ca686ada2347bf440c6349551d1539f99ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: typing Related to mypy type annotations open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable torch.sparse typechecks during CI

6 participants