About DataLoader shuffle

Is there any way to get the same shuffle result when I call loader() function twice?
(maybe like seed…)

def loader():
     DataLoader(..., shuffle=True, ...)

Setting the torch seed or just using your own sampler

@SimonW
Thanks for reply.
Here is my code but seed is not works as I expected.

def loader():
    DataLoader(..., shuffle=True, ...)
manual_seed = random.randint(1, 10000)
print("Random Seed: ", manual_seed)
random.seed(manual_seed)
torch.manual_seed(manual_seed)
torch.cuda.manual_seed_all(manual_seed)
Use loader() here 1st.
Use loader() here 2nd.

you need to seed before using loader at each time. However, seeding really should be a way to generate reproducible program. if you need same order occurring within a program, just write your own sampler.