油压是什么意思

paddle. batch ( reader: Callable[[], Generator[_T, None, None]], batch_size: int, drop_last: bool = False ) Callable[[], Generator[list[_T], None, None]] [source]
百度 76股破净40只市净率低于:46来源:数据宝证券时报股市大数据新媒体“数据宝”统计,截至3月23日收盘,有76只个股跌破每股净资产,其中湖北宜化、华夏银行、厦门信达等个股市净率最低,分别为倍、倍、倍。

This operator creates a batched reader which combines the data from the input reader to batched data.

Parameters
  • reader (generator) – the data reader to read from.

  • batch_size (int) – size of each mini-batch.

  • drop_last (bool, optional) – If set to True, the last batch is dropped when the size of last batch is not equal to batch_size, if set to False, it will not. Default: False.

Returns

The batched reader.

Return Type:

generator

Examples

>>> import paddle
>>> def reader():
...     for i in range(10):
...         yield i
>>> batch_reader = paddle.batch(reader, batch_size=2)

>>> for data in batch_reader():
...     print(data)
...
[0, 1]
[2, 3]
[4, 5]
[6, 7]
[8, 9]