r"""Returns an iterable for the buffers of the module. Buffer is defined to be :class:`~.Tensor` excluding :class:`~.Parameter`. Args: recursive: if ``True``, returns all buffers within this module, else only returns buffers that are direct attributes
(self, recursive: bool = True, **kwargs)
| 262 | ) |
| 263 | |
| 264 | def buffers(self, recursive: bool = True, **kwargs) -> Iterable[Tensor]: |
| 265 | r"""Returns an iterable for the buffers of the module. |
| 266 | |
| 267 | Buffer is defined to be :class:`~.Tensor` excluding :class:`~.Parameter`. |
| 268 | |
| 269 | Args: |
| 270 | recursive: if ``True``, returns all buffers within this |
| 271 | module, else only returns buffers that are direct attributes |
| 272 | """ |
| 273 | yield from self._flatten( |
| 274 | with_key=False, predicate=_is_buffer, recursive=recursive, **kwargs |
| 275 | ) |
| 276 | |
| 277 | def named_buffers( |
| 278 | self, prefix: Optional[str] = None, recursive: bool = True, **kwargs |