def path_load_node() -> Path: def gen_tmp_file(): while True: yield Path(tempfile.mkstemp()[1]) gen = gen_tmp_file() loader = DataLoader(gen=gen, batch_size=2) node = LoaderNode(loader=loader) return node
def loader_node() -> LoaderNode[str]: lst: List[str] = ['hi', 'hello', 'konnichiwa'] loader: DataLoader[str] = DataLoader(gen=lst, batch_size=2) node: LoaderNode[str] = LoaderNode(loader=loader) return node
def int_loader_node() -> LoaderNode[int]: lst: int = [1, 2, 3] loader: DataLoader[int] = DataLoader(gen=lst, batch_size=2) node: LoaderNode[int] = LoaderNode(loader=loader) return node