5
5
6
6
from collections .abc import Sequence
7
7
from copy import copy
8
- from typing import Optional , Union , overload
8
+ from typing import overload
9
9
10
10
from pytensor .compile .function .types import Function , UnusedInputError , orig_function
11
11
from pytensor .compile .io import In , Out
@@ -105,7 +105,7 @@ def rebuild_collect_shared(
105
105
106
106
107
107
def rebuild_collect_shared (
108
- outputs : Union [ Sequence [Variable ], Variable , Out , Sequence [Out ] ],
108
+ outputs : Sequence [Variable ] | Variable | Out | Sequence [Out ],
109
109
inputs = None ,
110
110
replace = None ,
111
111
updates = None ,
@@ -115,7 +115,7 @@ def rebuild_collect_shared(
115
115
clone_inner_graphs = False ,
116
116
) -> tuple [
117
117
list [Variable ],
118
- Union [ list [Variable ], Variable , Out , list [Out ] ],
118
+ list [Variable ] | Variable | Out | list [Out ],
119
119
tuple [
120
120
dict [Variable , Variable ],
121
121
dict [SharedVariable , Variable ],
@@ -376,7 +376,7 @@ def pfunc(
376
376
profile = None ,
377
377
on_unused_input = None ,
378
378
output_keys = None ,
379
- fgraph : Optional [ FunctionGraph ] = None ,
379
+ fgraph : FunctionGraph | None = None ,
380
380
) -> Function :
381
381
"""
382
382
Function-constructor for graphs with shared variables.
@@ -484,7 +484,7 @@ def construct_pfunc_ins_and_outs(
484
484
no_default_updates = False ,
485
485
rebuild_strict = True ,
486
486
allow_input_downcast = None ,
487
- fgraph : Optional [ FunctionGraph ] = None ,
487
+ fgraph : FunctionGraph | None = None ,
488
488
):
489
489
"""Construct inputs and outputs for `pfunc`.
490
490
0 commit comments