Skip to content

Commit db78c07

Browse files
malfetfacebook-github-bot
authored andcommittedAug 24, 2020
Enable torch.cuda.nvtx typechecking (pytorch#43443)
Summary: Add pyi file covering torch._C.nvtx submodule Fixes pytorch#43436 Pull Request resolved: pytorch#43443 Reviewed By: ezyang Differential Revision: D23280188 Pulled By: malfet fbshipit-source-id: 882860cce9feb0b5307c8b7c887f4a2f2c1548a2
1 parent 2f9c979 commit db78c07

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed
 

‎mypy.ini

-3
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,6 @@ ignore_errors = True
204204
[mypy-torch.cuda.nccl]
205205
ignore_errors = True
206206

207-
[mypy-torch.cuda.nvtx]
208-
ignore_errors = True
209-
210207
[mypy-torch._lobpcg]
211208
ignore_errors = True
212209

‎torch/_C/_nvtx.pyi

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Defined in torch/csrc/cuda/shared/nvtx.cpp
2+
def rangePushA(message: str) -> int: ...
3+
def rangePop() -> int: ...
4+
def markA(message: str) -> None: ...

‎torch/cuda/nvtx.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def _fail(*args, **kwargs):
1010
rangePop = _fail
1111
markA = _fail
1212

13-
_nvtx = _NVTXStub()
13+
_nvtx = _NVTXStub() # type: ignore[assignment]
1414

1515
__all__ = ['range_push', 'range_pop', 'mark']
1616

0 commit comments

Comments
 (0)
Please sign in to comment.