MCPcopy Create free account
hub / github.com/tensorflow/models / step_fn

Method step_fn

official/core/base_trainer.py:386–397  ·  view source on GitHub ↗
(inputs)

Source from the content-addressed store, hash-verified

384 """See base class."""
385
386 def step_fn(inputs):
387 if self.config.runtime.enable_xla and (self.config.runtime.num_gpus > 0):
388 task_train_step = tf.function(self.task.train_step, jit_compile=True)
389 else:
390 task_train_step = self.task.train_step
391 logs = task_train_step(
392 inputs,
393 model=self.model,
394 optimizer=self.optimizer,
395 metrics=self.train_metrics)
396 self._train_loss.update_state(logs[self.task.loss])
397 self.global_step.assign_add(1)
398
399 inputs = self.next_train_inputs(iterator)
400 self.strategy.run(step_fn, args=(inputs,), options=self._runtime_options)

Callers

nothing calls this directly

Calls 3

functionMethod · 0.80
update_stateMethod · 0.45
validation_stepMethod · 0.45

Tested by

no test coverage detected