The way this problem was solved was using the following structure in a side code which load the sampler:
if type(samples)==list:
samples = samples[1].to(device, non_blocking=True)
else:
samples = samples.to(device, non_blocking=True)
This works either using a local stored dataset in Sagemaker or using S3torchconnector. By doing this the code was able to read and train a list.