File size: 1,018 Bytes
9c6594c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from typing import Any, Iterator, List, TypeVar

from .pytorch import IterableDataset
from .utils import PipelineStage

T = TypeVar('T')

def add_length_method(obj: Any) -> Any: ...

class DataPipeline(IterableDataset, PipelineStage):
    pipeline: List[Any]
    length: int
    repetitions: int
    nsamples: int
    size: int

    def __init__(self, *args: Any, **kwargs: Any) -> None: ...
    def close(self) -> None: ...
    def invoke(self, f: Any, *args: Any, **kwargs: Any) -> Any: ...
    def iterator1(self) -> Iterator[Any]: ...
    def iterator(self) -> Iterator[Any]: ...
    def __iter__(self) -> Iterator[Any]: ...
    def stage(self, i: int) -> Any: ...
    def append(self, f: Any) -> None: ...
    def compose(self, *args: Any) -> 'DataPipeline': ...
    def with_length(self, n: int, silent: bool = False) -> 'DataPipeline': ...
    def with_epoch(self, nsamples: int = -1, nbatches: int = -1) -> 'DataPipeline': ...
    def repeat(self, nepochs: int = -1, nbatches: int = -1) -> 'DataPipeline': ...