Function - get_dataloader#
- openfl.utilities.dataloading.get_dataloader(plan, prefer_minimal=False, input_shape=None, collaborator_index=0)[source]#
Get dataloader instance from plan
NOTE: if prefer_minimal is False, cwd must be the workspace directory because we need to construct dataloader from actual collaborator data path with actual data present.
- Parameters:
plan (Plan) – plan object linked with the dataloader
prefer_minimal (bool ?) – prefer to use MockDataLoader which can be used to more easily instantiate task_runner without any initial data. Default to False.
input_shape (list | dict ?) – input_shape denoted by list notation [a,b,c, …] or in case of multihead models, dict object with individual layer keys such as {“input_0”: [a,b,…], “output_1”: [x,y,z, …]} Defaults to None.
collaborator_index (int ?) – which collaborator should be used for initializing dataloader among collaborators specified in plan/data.yaml. Defaults to 0.
- Returns:
DataLoader instance
- Return type:
data_loader (DataLoader)