Thank you @tom for clarifying the doubts.
In the torch.utils.DataLoader argument, we can pass a function declaration to worker_init_fn. Is it advisable to use  worker_init_fn to access the worker’s current seed and seed the other accompanying libraries like random based on the same seed ?
    worker_seed = torch.initial_seed() % 2**32
    numpy.random.seed(worker_seed)
    random.seed(worker_seed)

DataLoader(
    train_dataset,
    batch_size=batch_size,
    num_workers=num_workers,
    worker_init_fn=seed_worker
)
```. (As mentioned in https://pytorch.org/docs/stable/notes/randomness.html#dataloader)