MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _set_default_writer

Method _set_default_writer

tensorflow/python/keras/callbacks.py:1587–1601  ·  view source on GitHub ↗

Sets the default writer for custom batch-level summaries.

(self, writer_name)

Source from the content-addressed store, hash-verified

1585 return self._writers[writer_name]
1586
1587 def _set_default_writer(self, writer_name):
1588 """Sets the default writer for custom batch-level summaries."""
1589 if self.update_freq == 'epoch':
1590 # Writer is only used for custom summaries, which are written
1591 # batch-by-batch.
1592 return
1593 writer = self._get_writer(writer_name)
1594 step = self._total_batches_seen[writer_name]
1595 context.context().summary_writer = writer
1596
1597 def _should_record():
1598 return math_ops.equal(step % self.update_freq, 0)
1599
1600 context.context().summary_recording = _should_record
1601 summary_ops_v2.set_step(step)
1602
1603 def _init_batch_steps(self):
1604 """Create the total batch counters."""

Callers 2

on_test_beginMethod · 0.95
on_epoch_beginMethod · 0.95

Calls 3

_get_writerMethod · 0.95
set_stepMethod · 0.80
contextMethod · 0.45

Tested by

no test coverage detected