Set states for this layer and all sublayers Args: states(dict): A dictionary contains state names and corresponding values. The value shoud be either a PyTensor or numpy ndarray
(self, states)
| 153 | return states |
| 154 | |
| 155 | def set_states(self, states): |
| 156 | """ Set states for this layer and all sublayers |
| 157 | |
| 158 | Args: |
| 159 | states(dict): A dictionary contains state names and |
| 160 | corresponding values. The value shoud be either a |
| 161 | PyTensor or numpy ndarray |
| 162 | """ |
| 163 | names = states.keys() |
| 164 | sublayers = self._layers |
| 165 | for name, sublayer in sublayers.items(): |
| 166 | if sublayer._initialized: |
| 167 | if self._has_layer_param(sublayer, names): |
| 168 | sublayer.set_states(states) |
| 169 | self.set_params(states) |
| 170 | |
| 171 | def dtype_check(self, *inputs): |
| 172 | """ check if all input have same data type. |
nothing calls this directly
no test coverage detected