aesara.tensor.flatten#
- aesara.tensor.flatten(x, ndim=1)[source]#
Return a copy of the array collapsed into one dimension.
Reshapes the variable
xby keeping the first outdim-1 dimension size(s) ofxthe same, and making the last dimension size ofxequal 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