MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / AttrDict

Class AttrDict

usr/diff/net.py:16–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15
16class AttrDict(dict):
17 def __init__(self, *args, **kwargs):
18 super(AttrDict, self).__init__(*args, **kwargs)
19 self.__dict__ = self
20
21 def override(self, attrs):
22 if isinstance(attrs, dict):
23 self.__dict__.update(**attrs)
24 elif isinstance(attrs, (list, tuple, set)):
25 for attr in attrs:
26 self.override(attr)
27 elif attrs is not None:
28 raise NotImplementedError
29 return self
30
31
32class SinusoidalPosEmb(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected