megengine.traced_module.TracedModule.named_buffers

TracedModule.named_buffers(prefix=None, recursive=True, **kwargs)

Returns an iterable for key buffer pairs of the module, where key is the dotted path from this module to the buffer.

Buffer is defined to be Tensor excluding Parameter.

参数
  • prefix (Optional[str]) – prefix prepended to the keys.

  • recursive (bool) – if True, returns all buffers within this module, else only returns buffers that are direct attributes of this module.

  • prefix – Optional[str]:

返回类型

Iterable[Tuple[str, Tensor]]