2525from pytensor .raise_op import Assert
2626from pytensor .tensor .basic import (
2727 as_tensor_variable ,
28- get_underlying_scalar_constant_value ,
28+ get_scalar_constant_value ,
2929)
3030from pytensor .tensor .exceptions import NotScalarConstantError
3131from pytensor .tensor .variable import TensorConstant , TensorVariable
@@ -497,8 +497,8 @@ def check_dim(given, computed):
497497 if given is None or computed is None :
498498 return True
499499 try :
500- given = get_underlying_scalar_constant_value (given )
501- computed = get_underlying_scalar_constant_value (computed )
500+ given = get_scalar_constant_value (given )
501+ computed = get_scalar_constant_value (computed )
502502 return int (given ) == int (computed )
503503 except NotScalarConstantError :
504504 # no answer possible, accept for now
@@ -534,7 +534,7 @@ def assert_conv_shape(shape):
534534 out_shape = []
535535 for i , n in enumerate (shape ):
536536 try :
537- const_n = get_underlying_scalar_constant_value (n )
537+ const_n = get_scalar_constant_value (n )
538538 if i < 2 :
539539 if const_n < 0 :
540540 raise ValueError (
@@ -2203,9 +2203,7 @@ def __init__(
22032203 if imshp_i is not None :
22042204 # Components of imshp should be constant or ints
22052205 try :
2206- get_underlying_scalar_constant_value (
2207- imshp_i , only_process_constants = True
2208- )
2206+ get_scalar_constant_value (imshp_i , only_process_constants = True )
22092207 except NotScalarConstantError :
22102208 raise ValueError (
22112209 "imshp should be None or a tuple of constant int values"
@@ -2218,9 +2216,7 @@ def __init__(
22182216 if kshp_i is not None :
22192217 # Components of kshp should be constant or ints
22202218 try :
2221- get_underlying_scalar_constant_value (
2222- kshp_i , only_process_constants = True
2223- )
2219+ get_scalar_constant_value (kshp_i , only_process_constants = True )
22242220 except NotScalarConstantError :
22252221 raise ValueError (
22262222 "kshp should be None or a tuple of constant int values"
0 commit comments