MCPcopy Create free account
hub / github.com/apache/singa / get_states

Method get_states

python/singa/layer.py:140–153  ·  view source on GitHub ↗

Get states of this layer and all sublayers Returns: states(dict): A dictionary contains state names and values of this layer and all sublayers.

(self)

Source from the content-addressed store, hash-verified

138 sublayer.set_params(parameters)
139
140 def get_states(self):
141 """ Get states of this layer and all sublayers
142
143 Returns:
144 states(dict): A dictionary contains state names and values
145 of this layer and all sublayers.
146 """
147 states = dict()
148 sublayers = self._layers
149 for name, sublayer in sublayers.items():
150 if sublayer._initialized:
151 states.update(sublayer.get_states())
152 states.update(self.get_params())
153 return states
154
155 def set_states(self, states):
156 """ Set states for this layer and all sublayers

Callers 2

forwardMethod · 0.45
forwardMethod · 0.45

Calls 2

get_paramsMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected