This won’t be possible, as expand works on singleton dimensions. From the docs:

Returns a new view of the :attr:self tensor with singleton dimensions expanded to a larger size. […] Any dimension of size 1 can be expanded to an arbitrary value without allocating new memory.