pymc.math.flatten#
- pymc.math.flatten(x, ndim=1)[source]#
Return a copy of the array collapsed into one dimension.
Reshapes the variable x by keeping the first outdim-1 dimension size(s) of x the same, and making the last dimension size of x equal to the multiplication of its remaining dimension size(s).
- Parameters:
- x
pytensor.tensor.var.TensorVariable
The variable to be reshaped.
- ndim
int
The number of dimensions of the returned variable The default value is
1
.
- x
- Returns:
pytensor.tensor.var.TensorVariable
the flattened variable with dimensionality of outdim