MCPcopy Create free account
hub / github.com/open-mmlab/mmengine / CustomLinear

Class CustomLinear

tests/test_model/test_base_module.py:188–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 # Test build model from Pretrained weights
187
188 class CustomLinear(BaseModule):
189
190 def __init__(self, init_cfg=None):
191 super().__init__(init_cfg)
192 self.linear = nn.Linear(1, 1)
193
194 def init_weights(self):
195 constant_(self.linear.weight, 1)
196 constant_(self.linear.bias, 2)
197
198 @FOOMODELS.register_module()
199 class PratrainedModel(FooModel):

Callers 2

__init__Method · 0.85
test_init_weightsMethod · 0.85

Calls

no outgoing calls

Tested by 2

__init__Method · 0.68
test_init_weightsMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…