Hi,
What .clone() does is allocate brand new memory and copy the content of the Tensor into it. It always creates a new contiguous Tensor as output.
The thing with expand is that it does not actually allocate new memory but play with stride. Unfortunately, not all functions support non-standard strides (non-contiguous Tensors).
I guess that your function is one of these and so the clone fixes it by making sure the input is contiguous.
A more explicit way to do this, is to do feats = feats.contiguous() so that, if feats is already contiguous, nothing will happen. Compared to clone which will always make a full copy.