File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,9 @@ def c_code_cache_version(self):
146
146
def shape (x : Union [np .ndarray , Number , Variable ]) -> Variable :
147
147
"""Return the shape of `x`."""
148
148
if not isinstance (x , Variable ):
149
- x = ptb .as_tensor_variable (x ) # type: ignore
149
+ # The following is a type error in Python 3.9 but not 3.12.
150
+ # Thus we need to ignore unused-ignore on 3.12.
151
+ x = ptb .as_tensor_variable (x ) # type: ignore[arg-type,unused-ignore]
150
152
151
153
return cast (Variable , _shape (x ))
152
154
@@ -579,7 +581,9 @@ def specify_shape(
579
581
580
582
# If the specified shape is already encoded in the input static shape, do nothing
581
583
# This ignores PyTensor constants in shape
582
- x = ptb .as_tensor_variable (x ) # type: ignore
584
+ x = ptb .as_tensor_variable (x ) # type: ignore[arg-type,unused-ignore]
585
+ # The above is a type error in Python 3.9 but not 3.12.
586
+ # Thus we need to ignore unused-ignore on 3.12.
583
587
new_shape_info = any (
584
588
s != xts for (s , xts ) in zip (shape , x .type .shape ) if s is not None
585
589
)
You can’t perform that action at this time.
0 commit comments