Return the size (number of batches) for the dataset created. For certain type of the data input, the number of batches is known, eg for Numpy data, the size is same as (number_of_element / batch_size). Whereas for dataset or python generator, the size is unknown since it may or may not
(self)
| 123 | |
| 124 | @abc.abstractmethod |
| 125 | def get_size(self): |
| 126 | """Return the size (number of batches) for the dataset created. |
| 127 | |
| 128 | For certain type of the data input, the number of batches is known, eg for |
| 129 | Numpy data, the size is same as (number_of_element / batch_size). Whereas |
| 130 | for dataset or python generator, the size is unknown since it may or may not |
| 131 | have a end state. |
| 132 | |
| 133 | Returns: |
| 134 | int, the number of batches for the dataset, or None if it is unknown. The |
| 135 | caller could use this to control the loop of training, show progress bar, |
| 136 | or handle unexpected StopIteration error. |
| 137 | """ |
| 138 | raise NotImplementedError |
| 139 | |
| 140 | @abc.abstractmethod |
| 141 | def batch_size(self): |
no outgoing calls