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

Class CustomModule

python/oneflow/test/modules/test_module.py:177–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175 @flow.unittest.skip_unless_1n1d()
176 def test_nested_module(test_case):
177 class CustomModule(flow.nn.Module):
178 def __init__(self):
179 super().__init__()
180 self.relu = flow.nn.ReLU()
181
182 def forward(self, x):
183 return self.relu(x)
184
185 m = CustomModule()
186 x = flow.Tensor(2, 3)

Callers 11

test_nested_moduleMethod · 0.70
test_load_state_dictMethod · 0.70
test_state_dictMethod · 0.70
test_module_forwardMethod · 0.70
test_module_setattrMethod · 0.70
test_module_applyMethod · 0.70
test_module_cpu_cudaMethod · 0.70
test_module_submoduleMethod · 0.70

Calls

no outgoing calls

Tested by 11

test_nested_moduleMethod · 0.56
test_load_state_dictMethod · 0.56
test_state_dictMethod · 0.56
test_module_forwardMethod · 0.56
test_module_setattrMethod · 0.56
test_module_applyMethod · 0.56
test_module_cpu_cudaMethod · 0.56
test_module_submoduleMethod · 0.56