提交 082081ae authored 作者: Virgile Andreani's avatar Virgile Andreani 提交者: Ricardo Vieira

Remove noqas that are already taken care of

上级 06c5acdf
...@@ -249,7 +249,7 @@ def fast_inplace_check(fgraph, inputs): ...@@ -249,7 +249,7 @@ def fast_inplace_check(fgraph, inputs):
return inputs return inputs
class DestroyHandler(Bookkeeper): # noqa class DestroyHandler(Bookkeeper):
""" """
The DestroyHandler class detects when a graph is impossible to evaluate The DestroyHandler class detects when a graph is impossible to evaluate
because of aliasing and destructive operations. because of aliasing and destructive operations.
......
...@@ -1718,7 +1718,7 @@ class _CThunk: ...@@ -1718,7 +1718,7 @@ class _CThunk:
def __init__(self, cthunk, init_tasks, tasks, error_storage, module): def __init__(self, cthunk, init_tasks, tasks, error_storage, module):
# Lazy import to avoid compilation when importing pytensor. # Lazy import to avoid compilation when importing pytensor.
from pytensor.link.c.cutils import run_cthunk # noqa from pytensor.link.c.cutils import run_cthunk
self.run_cthunk = run_cthunk self.run_cthunk = run_cthunk
self.cthunk = cthunk self.cthunk = cthunk
......
...@@ -23,7 +23,7 @@ lazylinker_ext: Optional[ModuleType] = None ...@@ -23,7 +23,7 @@ lazylinker_ext: Optional[ModuleType] = None
def try_import(): def try_import():
global lazylinker_ext global lazylinker_ext
sys.path[0:0] = [config.compiledir] sys.path[0:0] = [config.compiledir]
import lazylinker_ext # noqa import lazylinker_ext
del sys.path[0] del sys.path[0]
...@@ -167,4 +167,4 @@ except ImportError: ...@@ -167,4 +167,4 @@ except ImportError:
from lazylinker_ext.lazylinker_ext import CLazyLinker, get_version # noqa from lazylinker_ext.lazylinker_ext import CLazyLinker, get_version # noqa
from lazylinker_ext.lazylinker_ext import * # noqa from lazylinker_ext.lazylinker_ext import * # noqa
assert force_compile or (version == get_version()) # noqa assert force_compile or (version == get_version())
...@@ -3395,7 +3395,7 @@ def profile_printer( ...@@ -3395,7 +3395,7 @@ def profile_printer(
) )
@op_debug_information.register(Scan) # noqa @op_debug_information.register(Scan)
def _op_debug_information_Scan(op: Scan, node: Apply): def _op_debug_information_Scan(op: Scan, node: Apply):
from collections.abc import Sequence from collections.abc import Sequence
......
...@@ -5,7 +5,7 @@ To update the `Scan` Cython code you must ...@@ -5,7 +5,7 @@ To update the `Scan` Cython code you must
- update the version value in this file and in `scan_perform.pyx` - update the version value in this file and in `scan_perform.pyx`
""" """
from pytensor.scan.scan_perform import get_version, perform # noqa: F401, E402 from pytensor.scan.scan_perform import get_version, perform # noqa: F401
version = 0.326 # must match constant returned in function get_version() version = 0.326 # must match constant returned in function get_version()
......
...@@ -158,7 +158,7 @@ class ConvolutionIndices(Op): ...@@ -158,7 +158,7 @@ class ConvolutionIndices(Op):
for ox in np.arange(lbound[1], ubound[1], dx, dtype=int): for ox in np.arange(lbound[1], ubound[1], dx, dtype=int):
# kern[l] is filter value to apply at (oj,oi) # kern[l] is filter value to apply at (oj,oi)
# for (iy,ix) # for (iy,ix)
l = 0 # noqa: E741 l = 0
# ... ITERATE OVER INPUT UNITS IN RECEPTIVE FIELD # ... ITERATE OVER INPUT UNITS IN RECEPTIVE FIELD
for ky in oy + np.arange(kshp[0], dtype=int): for ky in oy + np.arange(kshp[0], dtype=int):
......
...@@ -99,35 +99,38 @@ def _get_vector_length_Constant(op: Union[Op, Variable], var: Constant) -> int: ...@@ -99,35 +99,38 @@ def _get_vector_length_Constant(op: Union[Op, Variable], var: Constant) -> int:
return len(var.data) return len(var.data)
import pytensor.tensor.exceptions # noqa import pytensor.tensor.exceptions
from pytensor.gradient import grad, hessian, jacobian # noqa import pytensor.tensor.rewriting
from pytensor.gradient import grad, hessian, jacobian
# adds shared-variable constructors # adds shared-variable constructors
from pytensor.tensor import sharedvar # noqa from pytensor.tensor import (
from pytensor.tensor import ( # noqa
blas, blas,
blas_c, blas_c,
blas_scipy, blas_scipy,
sharedvar,
xlogx, xlogx,
) )
import pytensor.tensor.rewriting
# isort: off # isort: off
from pytensor.tensor import linalg # noqa from pytensor.tensor import linalg
from pytensor.tensor import special from pytensor.tensor import special
# For backward compatibility # For backward compatibility
from pytensor.tensor import nlinalg # noqa from pytensor.tensor import nlinalg
from pytensor.tensor import slinalg # noqa from pytensor.tensor import slinalg
# isort: on # isort: on
from pytensor.tensor.basic import * # noqa # Allow accessing numpy constants from pytensor.tensor
from pytensor.tensor.blas import batched_dot, batched_tensordot # noqa from numpy import e, euler_gamma, inf, infty, nan, newaxis, pi
from pytensor.tensor.extra_ops import *
from pytensor.tensor.shape import ( # noqa from pytensor.tensor.basic import *
from pytensor.tensor.blas import batched_dot, batched_tensordot
from pytensor.tensor.extra_ops import *
from pytensor.tensor.io import *
from pytensor.tensor.math import *
from pytensor.tensor.shape import (
reshape, reshape,
shape, shape,
shape_padaxis, shape_padaxis,
...@@ -137,21 +140,18 @@ from pytensor.tensor.shape import ( # noqa ...@@ -137,21 +140,18 @@ from pytensor.tensor.shape import ( # noqa
specify_shape, specify_shape,
) )
from pytensor.tensor.io import * # noqa
from pytensor.tensor.math import * # noqa
# We import as `_shared` instead of `shared` to avoid confusion between # We import as `_shared` instead of `shared` to avoid confusion between
# `pytensor.shared` and `tensor._shared`. # `pytensor.shared` and `tensor._shared`.
from pytensor.tensor.sort import argsort, argtopk, sort, topk, topk_and_argtopk # noqa from pytensor.tensor.sort import argsort, argtopk, sort, topk, topk_and_argtopk
from pytensor.tensor.subtensor import * # noqa from pytensor.tensor.subtensor import *
from pytensor.tensor.type import * # noqa from pytensor.tensor.type import *
from pytensor.tensor.type_other import * # noqa from pytensor.tensor.type_other import *
from pytensor.tensor.variable import TensorConstant, TensorVariable # noqa from pytensor.tensor.variable import TensorConstant, TensorVariable
from pytensor.tensor.functional import vectorize # noqa
# Allow accessing numpy constants from pytensor.tensor
from numpy import e, euler_gamma, inf, infty, nan, newaxis, pi # noqa # isort: off
from pytensor.tensor.functional import vectorize
# isort: on
__all__ = ["random"] # noqa: F405 __all__ = ["random"] # noqa: F405
...@@ -83,7 +83,7 @@ import numpy as np ...@@ -83,7 +83,7 @@ import numpy as np
try: try:
import numpy.__config__ # noqa import numpy.__config__
except ImportError: except ImportError:
pass pass
......
...@@ -63,7 +63,7 @@ from pytensor.tensor.rewriting.basic import register_specialize ...@@ -63,7 +63,7 @@ from pytensor.tensor.rewriting.basic import register_specialize
try: try:
import numpy.__config__ # noqa import numpy.__config__
except ImportError: except ImportError:
pass pass
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论