MCPcopy Create free account
hub / github.com/alibaba/graph-learn / apply

Method apply

graphlearn/python/nn/data.py:64–70  ·  view source on GitHub ↗

Applies the function `func` to all attributes.

(self, func)

Source from the content-addressed store, hash-verified

62 self._handler_dict = {}
63
64 def apply(self, func):
65 """Applies the function `func` to all attributes.
66 """
67 for k, v in self.__dict__.items():
68 if v is not None and k[:2] != '__' and k[-2:] != '__':
69 self.__dict__[k] = func(v)
70 return self
71
72 def __getitem__(self, key):
73 return getattr(self, key, None)

Callers 1

iteratorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected