Retrieves the weights of the model. Returns: A flat list of Numpy arrays.
(self)
| 160 | self._experimental_run_tf_function = False |
| 161 | |
| 162 | def get_weights(self): |
| 163 | """Retrieves the weights of the model. |
| 164 | |
| 165 | Returns: |
| 166 | A flat list of Numpy arrays. |
| 167 | """ |
| 168 | strategy = (self._distribution_strategy or |
| 169 | self._compile_time_distribution_strategy) |
| 170 | if strategy: |
| 171 | with strategy.scope(): |
| 172 | return super(Model, self).get_weights() |
| 173 | return super(Model, self).get_weights() |
| 174 | |
| 175 | def load_weights(self, filepath, by_name=False): |
| 176 | """Loads all layer weights, either from a TensorFlow or an HDF5 file.""" |