annotate torch._tensor_str (#48463)

Summary:
Fixes https://github.com/pytorch/pytorch/issues/48462

Pull Request resolved: https://github.com/pytorch/pytorch/pull/48463

Reviewed By: mrshenli

Differential Revision: D25187168

Pulled By: malfet

fbshipit-source-id: bb4ad1c6d376ad37995638615080452c71e36959
This commit is contained in:
Guilherme Leobas 2020-11-29 10:07:16 -08:00 committed by Facebook GitHub Bot
parent 36c87f1243
commit 2fe382e931
2 changed files with 6 additions and 8 deletions

View File

@ -68,9 +68,6 @@ ignore_errors = True
[mypy-torch.testing._internal.distributed.*]
ignore_errors = True
[mypy-torch._tensor_str]
ignore_errors = True
[mypy-torch.nn.modules.container]
ignore_errors = True

View File

@ -1,14 +1,15 @@
import math
import torch
from torch._six import inf
from typing import Union, Optional
class __PrinterOptions(object):
precision = 4
threshold = 1000
edgeitems = 3
linewidth = 80
sci_mode = None
precision: int = 4
threshold: Union[str, float] = 1000
edgeitems: int = 3
linewidth: int = 80
sci_mode: Optional[bool] = None
PRINT_OPTS = __PrinterOptions()