提交 151da532 authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Thomas Wiecki

Update pre-commit

上级 a30f815f
...@@ -7,7 +7,7 @@ exclude: | ...@@ -7,7 +7,7 @@ exclude: |
)$ )$
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0 rev: v4.4.0
hooks: hooks:
- id: debug-statements - id: debug-statements
exclude: | exclude: |
...@@ -25,9 +25,10 @@ repos: ...@@ -25,9 +25,10 @@ repos:
- id: black - id: black
language_version: python3 language_version: python3
- repo: https://github.com/pycqa/flake8 - repo: https://github.com/pycqa/flake8
rev: 5.0.4 rev: 6.0.0
hooks: hooks:
- id: flake8 - id: flake8
language_version: python39
- repo: https://github.com/pycqa/isort - repo: https://github.com/pycqa/isort
rev: 5.10.1 rev: 5.10.1
hooks: hooks:
......
...@@ -54,6 +54,7 @@ from typing import Callable, List, Optional, Union ...@@ -54,6 +54,7 @@ from typing import Callable, List, Optional, Union
import numpy as np import numpy as np
import pytensor import pytensor
import pytensor.link.utils as link_utils
from pytensor import tensor as at from pytensor import tensor as at
from pytensor.compile.builders import construct_nominal_fgraph, infer_shape from pytensor.compile.builders import construct_nominal_fgraph, infer_shape
from pytensor.compile.function.pfunc import pfunc from pytensor.compile.function.pfunc import pfunc
...@@ -75,7 +76,6 @@ from pytensor.graph.replace import clone_replace ...@@ -75,7 +76,6 @@ from pytensor.graph.replace import clone_replace
from pytensor.graph.utils import InconsistencyError, MissingInputError from pytensor.graph.utils import InconsistencyError, MissingInputError
from pytensor.link.c.basic import CLinker from pytensor.link.c.basic import CLinker
from pytensor.link.c.exceptions import MissingGXX from pytensor.link.c.exceptions import MissingGXX
from pytensor.link.utils import raise_with_op
from pytensor.printing import op_debug_information from pytensor.printing import op_debug_information
from pytensor.scan.utils import ScanProfileStats, Validator, forced_replace, safe_new from pytensor.scan.utils import ScanProfileStats, Validator, forced_replace, safe_new
from pytensor.tensor.basic import as_tensor_variable from pytensor.tensor.basic import as_tensor_variable
...@@ -1627,7 +1627,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph): ...@@ -1627,7 +1627,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph):
if hasattr(self.fn.vm, "position_of_error") and hasattr( if hasattr(self.fn.vm, "position_of_error") and hasattr(
self.fn.vm, "thunks" self.fn.vm, "thunks"
): ):
raise_with_op( link_utils.raise_with_op(
self.fn.maker.fgraph, self.fn.maker.fgraph,
self.fn.vm.nodes[self.fn.vm.position_of_error], self.fn.vm.nodes[self.fn.vm.position_of_error],
self.fn.vm.thunks[self.fn.vm.position_of_error], self.fn.vm.thunks[self.fn.vm.position_of_error],
...@@ -1930,7 +1930,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph): ...@@ -1930,7 +1930,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph):
# done by raise_with_op is not implemented in C. # done by raise_with_op is not implemented in C.
if hasattr(vm, "thunks"): if hasattr(vm, "thunks"):
# For the CVM # For the CVM
raise_with_op( link_utils.raise_with_op(
self.fn.maker.fgraph, self.fn.maker.fgraph,
vm.nodes[vm.position_of_error], vm.nodes[vm.position_of_error],
vm.thunks[vm.position_of_error], vm.thunks[vm.position_of_error],
...@@ -1940,7 +1940,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph): ...@@ -1940,7 +1940,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph):
# We don't have access from python to all the # We don't have access from python to all the
# temps values So for now, we just don't print # temps values So for now, we just don't print
# the extra shapes/strides info # the extra shapes/strides info
raise_with_op( link_utils.raise_with_op(
self.fn.maker.fgraph, vm.nodes[vm.position_of_error] self.fn.maker.fgraph, vm.nodes[vm.position_of_error]
) )
else: else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论