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