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

Method __init__

python/oneflow/test/graph/test_graph.py:44–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

42
43class CustomModule(flow.nn.Module):
44 def __init__(self):
45 super().__init__()
46 self.layer = SubModule()
47 self.fc1 = flow.nn.Linear(36, 4)
48 self.register_buffer("dummy_buff", flow.Tensor(1, 4))
49
50 def forward(self, x):
51 x = self.layer(x)

Callers

nothing calls this directly

Calls 4

register_bufferMethod · 0.80
SubModuleClass · 0.70
__init__Method · 0.45
TensorMethod · 0.45

Tested by

no test coverage detected