That works as well.
Not sure which one will be fastest and use less memory…
My personal preference is usually to avoid fancy advanced indexing because I’m not used to that semantic  Also allocating the arange() Tensor can be expensive depending on the sizes involved. Note that expand does not allocate memory so my solution don’t do any extra allocation.