MCPcopy Create free account
hub / github.com/pytorch/executorch / __init__

Method __init__

test/models/export_program.py:211–213  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

209
210class ModuleStateful(torch.nn.Module):
211 def __init__(self):
212 super().__init__()
213 self.register_buffer("state", torch.zeros(1, dtype=torch.int32))
214
215 def forward(self, x):
216 self.state.add_(1)

Callers

nothing calls this directly

Calls 3

register_bufferMethod · 0.80
zerosMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected