mindspore.dataset.Dataset.output_shapes
- Dataset.output_shapes(estimate=False)[source]
Get the shapes of output data.
- Parameters
estimate (bool) – If estimate is False, will return the shapes of first data row. Otherwise, will iterate the whole dataset and return the estimated shapes of data row, where dynamic shape is marked as None (used in dynamic data shapes scenario). Default: False.
- Returns
list, list of shapes of each column.
Examples
>>> import numpy as np >>> >>> def generator1(): ... for i in range(1, 100): ... yield np.ones((16, i, 83)), np.array(i) >>> >>> dataset = ds.GeneratorDataset(generator1, ["data1", "data2"]) >>> output_shapes = dataset.output_shapes()