The following issues were found
torch/nn/intrinsic/quantized/_reference/__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/nn/intrinsic/quantized/__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/nn/intrinsic/__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/lib/libshm/manager.cpp
2 issues
Line: 22
Column: 27
CWE codes:
134
Suggestion:
Use a constant for the format specification
#ifdef DEBUG_LOG
#define COLOR "\033[31;1m"
#define RESET "\033[0m"
#define __DEBUG(msg, ...) fprintf(stderr, COLOR msg "%c" RESET, __VA_ARGS__);
#define DEBUG(...) __DEBUG(__VA_ARGS__, '\n')
#else
#define DEBUG(...) (void)0
#endif
Reported by FlawFinder.
Line: 63
Column: 30
CWE codes:
126
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
size_t unused;
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
unused = write(1, message, strlen(message));
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
unused = write(1, "\n", 1);
}
bool object_exists(const char *name) {
Reported by FlawFinder.
torch/utils/data/datapipes/iter/routeddecoder.py
2 issues
Line: 1
Column: 1
from io import BufferedIOBase
from typing import Any, Callable, Iterable, Iterator, Sized, Tuple
from torch.utils.data import IterDataPipe, functional_datapipe
from torch.utils.data.datapipes.utils.decoder import (
Decoder,
basichandlers as decoder_basichandlers,
imagehandler as decoder_imagehandler,
extension_extract_fn)
Reported by Pylint.
Line: 42
Column: 5
handlers = (decoder_basichandlers, decoder_imagehandler('torch'))
self.decoder = Decoder(*handlers, key_fn=key_fn)
def add_handler(self, *handler: Callable) -> None:
self.decoder.add_handler(*handler)
def __iter__(self) -> Iterator[Tuple[str, Any]]:
for data in self.datapipe:
pathname = data[0]
Reported by Pylint.
torch/utils/data/datapipes/iter/readlinesfromfile.py
2 issues
Line: 1
Column: 1
from typing import Tuple
from torch.utils.data import IterDataPipe
class ReadLinesFromFileIterDataPipe(IterDataPipe[Tuple[str, str]]):
r""" :class:`ReadLinesFromFileDataPipe`
Iterable DataPipe to load file names as source iter data pipe
and yield filename and line(s).
Reported by Pylint.
Line: 5
Column: 1
from torch.utils.data import IterDataPipe
class ReadLinesFromFileIterDataPipe(IterDataPipe[Tuple[str, str]]):
r""" :class:`ReadLinesFromFileDataPipe`
Iterable DataPipe to load file names as source iter data pipe
and yield filename and line(s).
"""
Reported by Pylint.
torch/utils/file_baton.py
2 issues
Line: 1
Column: 1
import os
import time
class FileBaton:
'''A primitive, file-based synchronization utility.'''
def __init__(self, lock_file_path, wait_seconds=0.1):
'''
Reported by Pylint.
Line: 19
Column: 9
'''
self.lock_file_path = lock_file_path
self.wait_seconds = wait_seconds
self.fd = None
def try_acquire(self):
'''
Tries to atomically create a file under exclusive access.
Reported by Pylint.
torch/utils/hipify/__init__.py
2 issues
Line: 1
Column: 1
from .version import __version__
Reported by Pylint.
Line: 1
Column: 1
from .version import __version__
Reported by Pylint.
torch/nn/quantized/_reference/__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/nn/quantized/__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.