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)
| 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 |
no test coverage detected