Retrieves updates relevant to a specific set of inputs. Arguments: inputs: Input tensor or list/tuple of input tensors. Returns: List of update ops of the layer that depend on `inputs`.
(self, inputs)
| 1369 | return backend.batch_get_value(params) |
| 1370 | |
| 1371 | def get_updates_for(self, inputs): |
| 1372 | """Retrieves updates relevant to a specific set of inputs. |
| 1373 | |
| 1374 | Arguments: |
| 1375 | inputs: Input tensor or list/tuple of input tensors. |
| 1376 | |
| 1377 | Returns: |
| 1378 | List of update ops of the layer that depend on `inputs`. |
| 1379 | """ |
| 1380 | if inputs is None: |
| 1381 | # Requesting unconditional updates. |
| 1382 | return [u for u in self.updates if u._unconditional_update] |
| 1383 | |
| 1384 | # Requesting input-conditional updates. |
| 1385 | updates = [u for u in self.updates if not u._unconditional_update] |
| 1386 | inputs = nest.flatten(inputs) |
| 1387 | reachable = tf_utils.get_reachable_from_inputs(inputs, updates) |
| 1388 | return [u for u in updates if u in reachable] |
| 1389 | |
| 1390 | def get_losses_for(self, inputs): |
| 1391 | """Retrieves losses relevant to a specific set of inputs. |