Train and Validation using SequentialSampler(Sampler)

Hi,
Can somebody please help me to split my dataset into train and validation subsets.

I need it in a form:
train=dataset[:index]
val=dataset[index:]

I need to choose samples sequentionally.
How to do it with SequentialSampler()?

Thank you!