The following issues were found
torch/fx/experimental/unification/multipledispatch/__init__.py
3 issues
Line: 1
Column: 1
from .core import dispatch
from .dispatcher import (Dispatcher, halt_ordering, restart_ordering,
MDNotImplementedError)
Reported by Pylint.
Line: 2
Column: 1
from .core import dispatch
from .dispatcher import (Dispatcher, halt_ordering, restart_ordering,
MDNotImplementedError)
Reported by Pylint.
Line: 1
Column: 1
from .core import dispatch
from .dispatcher import (Dispatcher, halt_ordering, restart_ordering,
MDNotImplementedError)
Reported by Pylint.
torch/utils/model_zoo.py
3 issues
Line: 2
Column: 1
# torchvision imports tqdm from here.
from torch.hub import tqdm, load_state_dict_from_url as load_url # noqa: F401
Reported by Pylint.
Line: 2
Column: 1
# torchvision imports tqdm from here.
from torch.hub import tqdm, load_state_dict_from_url as load_url # noqa: F401
Reported by Pylint.
Line: 1
Column: 1
# torchvision imports tqdm from here.
from torch.hub import tqdm, load_state_dict_from_url as load_url # noqa: F401
Reported by Pylint.
torch/testing/_internal/data/network2.py
3 issues
Line: 4
Column: 1
import torch.nn as nn
class Net(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(10, 20)
self.relu = nn.ReLU()
Reported by Pylint.
Line: 1
Column: 1
import torch.nn as nn
class Net(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(10, 20)
self.relu = nn.ReLU()
Reported by Pylint.
Line: 4
Column: 1
import torch.nn as nn
class Net(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(10, 20)
self.relu = nn.ReLU()
Reported by Pylint.
torch/testing/_internal/data/network1.py
3 issues
Line: 4
Column: 1
import torch.nn as nn
class Net(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(10, 20)
Reported by Pylint.
Line: 1
Column: 1
import torch.nn as nn
class Net(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(10, 20)
Reported by Pylint.
Line: 4
Column: 1
import torch.nn as nn
class Net(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(10, 20)
Reported by Pylint.
torch/package/analyze/__init__.py
2 issues
Line: 1
Column: 1
from .trace_dependencies import (
trace_dependencies,
)
Reported by Pylint.
Line: 1
Column: 1
from .trace_dependencies import (
trace_dependencies,
)
Reported by Pylint.
torch/utils/data/datapipes/iter/loadfilesfromdisk.py
2 issues
Line: 36
Column: 3
self.mode: str = mode
if self.mode not in ('b', 't', 'rb', 'rt', 'r'):
raise ValueError("Invalid mode {}".format(mode))
# TODO: enforce typing for each instance based on mode, otherwise
# `argument_validation` with this DataPipe may be potentially broken
self.length: int = length
# Remove annotation due to 'IOBase' is a general type and true type
# is determined at runtime based on mode. Some `DataPipe` requiring
Reported by Pylint.
Line: 1
Column: 1
from io import IOBase
from typing import Iterable, Tuple
from torch.utils.data import IterDataPipe
from torch.utils.data.datapipes.utils.common import get_file_binaries_from_pathnames
class LoadFilesFromDiskIterDataPipe(IterDataPipe[Tuple[str, IOBase]]):
r""" :class:`LoadFilesFromDiskIterDataPipe`.
Reported by Pylint.
torch/nn/quantized/dynamic/__init__.py
2 issues
Line: 1
Column: 1
from .modules import * # noqa: F403
Reported by Pylint.
Line: 1
Column: 1
from .modules import * # noqa: F403
Reported by Pylint.
torch/utils/data/datapipes/iter/__init__.py
2 issues
Line: 1
Column: 1
from torch.utils.data.datapipes.iter.callable import (
CollateIterDataPipe as Collate,
MapIterDataPipe as Map,
TransformsIterDataPipe as Transforms,
)
from torch.utils.data.datapipes.iter.combinatorics import (
SamplerIterDataPipe as Sampler,
ShuffleIterDataPipe as Shuffle,
)
Reported by Pylint.
Line: 68
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
'Zip']
# Please keep this list sorted
assert __all__ == sorted(__all__)
Reported by Bandit.
torch/multiprocessing/_atfork.py
2 issues
Line: 9
Column: 21
import multiprocessing.util as _util
def _register(func):
def wrapper(arg):
func()
_util.register_after_fork(_register, wrapper)
else:
import os
Reported by Pylint.
Line: 1
Column: 1
import sys
__all__ = ['register_after_fork']
if sys.platform == 'win32' or sys.version_info < (3, 7):
import multiprocessing.util as _util
def _register(func):
def wrapper(arg):
Reported by Pylint.
torch/nn/qat/__init__.py
2 issues
Line: 1
Column: 1
from .modules import * # noqa: F403
Reported by Pylint.
Line: 1
Column: 1
from .modules import * # noqa: F403
Reported by Pylint.