MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / test_setattr_cls_from_kwargs

Function test_setattr_cls_from_kwargs

utils.py:26–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24
25
26def test_setattr_cls_from_kwargs():
27 class _test_cls:
28 def __init__(self):
29 self.a = 1
30 self.b = 'hello'
31
32 test_cls = _test_cls()
33 config = {'a': 3, 'b': 'change_hello', 'c': 5}
34 setattr_cls_from_kwargs(test_cls, config)
35 for key in config.keys():
36 print(f"{key}:\t {getattr(test_cls, key)}")
37
38
39def net_builder(net_name, from_name: bool, net_conf=None, is_remix=False):

Callers

nothing calls this directly

Calls 2

_test_clsClass · 0.85
setattr_cls_from_kwargsFunction · 0.85

Tested by

no test coverage detected