Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The shapes of the dataset returned by from_generator depend on the shapes of the elements generated by the generator function. Each element must have the same nested structure and shapes, and the resulting dataset will have the same structure but with batch dimension added to each shape. For example, if the generator function returns a tuple of two tensors with shapes (1, 32, 32, 3) and (1, 10), respectively, the resulting dataset will have a nested structure of (TensorShape([None, 32, 32, 3]), TensorShape([None, 10])), where the None dimension represents the batch size.