(self, cur_step, restart=True)
| 348 | self.last_time = time.time() |
| 349 | |
| 350 | def steps_per_second(self, cur_step, restart=True): |
| 351 | value = ((float(cur_step) - self.last_iteration) / |
| 352 | (time.time() - self.last_time)) |
| 353 | if restart: |
| 354 | self.start() |
| 355 | self.last_iteration = float(cur_step) |
| 356 | return value |
| 357 | |
| 358 | |
| 359 | def tensor_to_scalar(x): |