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

Class CustomModule

python/oneflow/test/modules/test_save_load.py:112–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 @flow.unittest.skip_unless_1n1d()
111 def test_save_state_dict(test_case):
112 class CustomModule(flow.nn.Module):
113 def __init__(self):
114 super().__init__()
115 self.param1 = flow.nn.Parameter(flow.Tensor(32, 1024, 1024))
116 self.param2 = flow.nn.Parameter(flow.Tensor(32, 1024, 1024))
117
118 def forward(self):
119 return self.param1 + self.param2
120
121 m = CustomModule()
122 res1 = m()

Calls

no outgoing calls