The * is used to unpack the following tuple or list.
In my code I’m using it to unpack input_window.size()[:-2] into the separate sizes.
Python creates therefore something like this:
tensor.view(*tensor.size(), -1)
# will be unpacked to
tensor.view(1, 1, 2, 2, -1)

You can read more about this operation here 2.