@@ -99,35 +99,38 @@ def _get_vector_length_Constant(op: Union[Op, Variable], var: Constant) -> int:
9999 return len (var .data )
100100
101101
102- import pytensor .tensor .exceptions # noqa
103- from pytensor .gradient import grad , hessian , jacobian # noqa
102+ import pytensor .tensor .exceptions
103+ import pytensor .tensor .rewriting
104+ from pytensor .gradient import grad , hessian , jacobian
104105
105106# adds shared-variable constructors
106- from pytensor .tensor import sharedvar # noqa
107- from pytensor .tensor import ( # noqa
107+ from pytensor .tensor import (
108108 blas ,
109109 blas_c ,
110110 blas_scipy ,
111+ sharedvar ,
111112 xlogx ,
112113)
113- import pytensor .tensor .rewriting
114114
115115
116116# isort: off
117- from pytensor .tensor import linalg # noqa
117+ from pytensor .tensor import linalg
118118from pytensor .tensor import special
119119
120120# For backward compatibility
121- from pytensor .tensor import nlinalg # noqa
122- from pytensor .tensor import slinalg # noqa
121+ from pytensor .tensor import nlinalg
122+ from pytensor .tensor import slinalg
123123
124124# isort: on
125- from pytensor .tensor .basic import * # noqa
126- from pytensor .tensor .blas import batched_dot , batched_tensordot # noqa
127- from pytensor .tensor .extra_ops import *
128-
125+ # Allow accessing numpy constants from pytensor.tensor
126+ from numpy import e , euler_gamma , inf , infty , nan , newaxis , pi
129127
130- from pytensor .tensor .shape import ( # noqa
128+ from pytensor .tensor .basic import *
129+ from pytensor .tensor .blas import batched_dot , batched_tensordot
130+ from pytensor .tensor .extra_ops import *
131+ from pytensor .tensor .io import *
132+ from pytensor .tensor .math import *
133+ from pytensor .tensor .shape import (
131134 reshape ,
132135 shape ,
133136 shape_padaxis ,
@@ -137,21 +140,18 @@ def _get_vector_length_Constant(op: Union[Op, Variable], var: Constant) -> int:
137140 specify_shape ,
138141)
139142
140-
141- from pytensor .tensor .io import * # noqa
142- from pytensor .tensor .math import * # noqa
143-
144143# We import as `_shared` instead of `shared` to avoid confusion between
145144# `pytensor.shared` and `tensor._shared`.
146- from pytensor .tensor .sort import argsort , argtopk , sort , topk , topk_and_argtopk # noqa
147- from pytensor .tensor .subtensor import * # noqa
148- from pytensor .tensor .type import * # noqa
149- from pytensor .tensor .type_other import * # noqa
150- from pytensor .tensor .variable import TensorConstant , TensorVariable # noqa
151- from pytensor .tensor .functional import vectorize # noqa
145+ from pytensor .tensor .sort import argsort , argtopk , sort , topk , topk_and_argtopk
146+ from pytensor .tensor .subtensor import *
147+ from pytensor .tensor .type import *
148+ from pytensor .tensor .type_other import *
149+ from pytensor .tensor .variable import TensorConstant , TensorVariable
152150
153- # Allow accessing numpy constants from pytensor.tensor
154- from numpy import e , euler_gamma , inf , infty , nan , newaxis , pi # noqa
151+
152+ # isort: off
153+ from pytensor .tensor .functional import vectorize
154+ # isort: on
155155
156156
157157__all__ = ["random" ] # noqa: F405
0 commit comments