RandomSplitter

Hi,

I was looking at the source code of the fastai function - RandomSplitter.

I assume ‘o’, in this function is the data (includes training and validation).

My question how ‘o’ gets passed to this function?
Thank you.

def RandomSplitter(valid_pct=0.2, seed=None, **kwargs):
“Create function that splits items between train/val with valid_pct randomly.”
def _inner(o, **kwargs):
if seed is not None: torch.manual_seed(seed)
rand_idx = L(int(i) for i in torch.randperm(len(o)))
cut = int(valid_pct * len(o))
return rand_idx[cut:],rand_idx[:cut]
return _inner