@@ -2673,36 +2673,29 @@ def vertical_stack(*args):
2673
2673
return concatenate (_args , axis = 0 )
2674
2674
2675
2675
2676
- def is_flat (var , ndim = None , outdim = None ):
2676
+ def is_flat (var , ndim = 1 ):
2677
2677
"""
2678
2678
Verifies the dimensionality of the var is equal to
2679
- outdim . This method is usually called after flatten method on a
2680
- variable, where the first outdim -1 dimension size(s) of the variable
2679
+ ndim . This method is usually called after flatten method on a
2680
+ variable, where the first ndim -1 dimension size(s) of the variable
2681
2681
is kept intact, and the last dimension size of the variable is made
2682
2682
equal to the multiplication of its remaining dimension size(s), such that
2683
- the variable would end up with as many dimension as outdim .
2683
+ the variable would end up with as many dimension as ndim .
2684
2684
2685
2685
Parameters
2686
2686
----------
2687
- var : pytensor.tensor.var.TensorVariable
2688
- the pytensor var on which the dimensionality is checked.
2687
+ var : pytensor.tensor.var.TensorVariable
2688
+ the pytensor var on which the dimensionality is checked.
2689
2689
2690
- outdim : int
2691
- the expected dimensionality of var.
2690
+ ndim : int
2691
+ the expected dimensionality of var.
2692
2692
2693
2693
Returns
2694
2694
-------
2695
2695
bool
2696
2696
the comparison result of var's dim
2697
2697
and the expected outdim.
2698
2698
"""
2699
- if outdim is None and ndim is None :
2700
- ndim = 1
2701
- elif outdim is not None and ndim is not None :
2702
- raise ValueError ("You should only specify ndim" )
2703
- elif outdim is not None :
2704
- warnings .warn ("outdim` is deprecated; use `ndim` instead." )
2705
- ndim = outdim
2706
2699
return var .ndim == ndim
2707
2700
2708
2701
0 commit comments