(self)
| 181 | return fetches |
| 182 | |
| 183 | def step(self): |
| 184 | # Do a batch of SGD. |
| 185 | result = self._step() |
| 186 | |
| 187 | # Update our counts and record it. |
| 188 | counts = self._counter.increment(steps=1) |
| 189 | result.update(counts) |
| 190 | |
| 191 | # Snapshot and attempt to write logs. |
| 192 | if self._snapshotter is not None: |
| 193 | self._snapshotter.save() |
| 194 | self._logger.write(result) |
| 195 | |
| 196 | def get_variables(self, names: List[str]) -> List[np.ndarray]: |
| 197 | return tf2_utils.to_numpy(self._variables) |