This function is used ubiquitously with tensors, so in order to make LinearOperator a drop-in replacement for tensors we need to use it.
reshape (other than view) will reallocate new memory if necessary - this concept doesn't really make a to of sense for LinearOperators, so a straightforward thing to do is just to make this an alias for expand and not allow reshaping the last two (non-batch) dimensions for now. The current implementation of course only makes sense for square LinearOperators (or rather operators where the non-batch dimensions don't change).
This function is used ubiquitously with tensors, so in order to make
LinearOperator
a drop-in replacement for tensors we need to use it.reshape
(other than view) will reallocate new memory if necessary - this concept doesn't really make a to of sense forLinearOperator
s, so a straightforward thing to do is just to make this an alias forexpand
and not allow reshaping the last two (non-batch) dimensions for now. The current implementation of course only makes sense for squareLinearOperator
s (or rather operators where the non-batch dimensions don't change).