aesara.tensor.TensorVariable.reshape#
- TensorVariable.reshape(shape, ndim=None)[source]#
Return a reshaped view/copy of this variable.
Returns a view of this
Variable
that has been reshaped as innumpy.reshape
. If the shape is aVariable
argument, then you might need to use the optionalndim
parameter to declare how many elements the shape has, and therefore how many dimensions the reshapedVariable
will have.- Parameters:
shape – Something that can be converted to a symbolic vector of integers.
ndim – The length of the shape. Passing None here means for Aesara to try and guess the length of
shape
.
Warning
This has a different signature than numpy’s ndarray.reshape! In numpy you do not need to wrap the shape arguments in a tuple, in aesara you do need to.