r""" buffers(recurse=True) -> Iterator[Tensor] Returns an iterator over module buffers. Args: recurse (bool): if True, then yields buffers of this module and all submodules. Otherwise, yields only buffers that are direct m
(self, recurse: bool = True)
| 580 | yield elem |
| 581 | |
| 582 | def buffers(self, recurse: bool = True) -> Iterator[Tensor]: |
| 583 | r""" |
| 584 | buffers(recurse=True) -> Iterator[Tensor] |
| 585 | |
| 586 | Returns an iterator over module buffers. |
| 587 | |
| 588 | Args: |
| 589 | recurse (bool): if True, then yields buffers of this module |
| 590 | and all submodules. Otherwise, yields only buffers that |
| 591 | are direct members of this module. |
| 592 | |
| 593 | Yields: |
| 594 | oneflow.Tensor: module buffer |
| 595 | |
| 596 | Example:: |
| 597 | |
| 598 | >>> for buf in model.buffers(): # doctest: +SKIP |
| 599 | ... print(type(buf), buf.size()) # doctest: +SKIP |
| 600 | <class 'oneflow.Tensor'> oneflow.Size([10]) |
| 601 | |
| 602 | """ |
| 603 | for (name, buf) in self.named_buffers(recurse=recurse): |
| 604 | yield buf |
| 605 | |
| 606 | def named_buffers( |
| 607 | self, prefix: str = "", recurse: bool = True |