Implements DataLoader load method. Builds the entire input pipeline inside the load method. Users can define states inside the DataLoader class and returns a tf.data dataset object. Args: input_context: This is a context class that is passed to the user's input functi
(
self,
input_context: Optional[tf.distribute.InputContext] = None
)
| 25 | |
| 26 | @abc.abstractmethod |
| 27 | def load( |
| 28 | self, |
| 29 | input_context: Optional[tf.distribute.InputContext] = None |
| 30 | ) -> tf.data.Dataset: |
| 31 | """Implements DataLoader load method. |
| 32 | |
| 33 | Builds the entire input pipeline inside the load method. Users can define |
| 34 | states inside the DataLoader class and returns a tf.data dataset |
| 35 | object. |
| 36 | |
| 37 | Args: |
| 38 | input_context: This is a context class that is passed to the user's input |
| 39 | function and contains information about the compute replicas and input |
| 40 | pipelines. This object is used for multi-host inputs and passed by the |
| 41 | distribution strategy. |
| 42 | |
| 43 | Returns: |
| 44 | A per-host tf.data dataset. Note that, we usually create the distributed |
| 45 | dataset through the load method, so we should not directly return a |
| 46 | distributed dataset here. |
| 47 | """ |
| 48 | pass |
no outgoing calls