MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / pre_forward_hook

Function pre_forward_hook

python/oneflow/nn/parallel/distributed.py:158–161  ·  view source on GitHub ↗
(module, input)

Source from the content-addressed store, hash-verified

156 if broadcast_buffers:
157
158 def pre_forward_hook(module, input):
159 with flow.no_grad():
160 buffers = list(module.buffers())
161 flow._C.comm_broadcast(buffers, inplace=True)
162
163 module.register_forward_pre_hook(pre_forward_hook)
164

Callers

nothing calls this directly

Calls 2

listFunction · 0.85
buffersMethod · 0.45

Tested by

no test coverage detected