I think there is a misunderstanding. I see that train ids in both codes are same.
First script:
15 examples of train
tensor([76., 59., 48., 42., 32., 49., 70.,  3., 98., 63., 90., 25., 91., 92.,
        51.])


Second script:
15 examples of train
tensor([76., 59., 48., 42., 32., 49., 70.,  3., 98., 63., 90., 25., 91., 92.,
        51.])

Or did I misunderstand your question?