[train_set](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.Subset "torch.utils.data.Subset"), [test_set](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.Subset "torch.utils.data.Subset") = torch.utils.data.random_split(alldata, [.85, .15], generator=[torch.Generator](https://docs.pytorch.org/docs/stable/generated/torch.Generator.html#torch.Generator "torch.Generator")([device](https://docs.pytorch.org/docs/stable/tensor_attributes.html#torch.device "torch.device")=[device](https://docs.pytorch.org/docs/stable/tensor_attributes.html#torch.device "torch.device")).manual_seed(2024)) print(f"train examples = {len([train_set](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.Subset "torch.utils.data.Subset"))}, validation examples = {len([test_set](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.Subset "torch.utils.data.Subset"))}")