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