aesara.tensor.flatten#
- aesara.tensor.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) ofx
the same, and making the last dimension size ofx
equal to the multiplication of its remaining dimension size(s).- Parameters:
x (aesara.tensor.var.TensorVariable) – The variable to be reshaped.
ndim (int) – The number of dimensions of the returned variable The default value is
1
.
- Returns:
the flattened variable with dimensionality of outdim
- Return type:
aesara.tensor.var.TensorVariable