W3cubDocs

/TensorFlow Python

tf.contrib.kfac.utils.batch_execute

tf.contrib.kfac.utils.batch_execute(
    global_step,
    thunks,
    batch_size,
    name=None
)

Defined in tensorflow/contrib/kfac/python/ops/utils.py.

Executes a subset of ops per global step.

Given a list of thunks, each of which produces a single stateful op, ensures that exactly 'batch_size' ops are run per global step. Ops are scheduled in a round-robin fashion. For example, with 3 ops

global_step | op0 | op1 | op2 ------------+-----+-----+----- 0 | x | x | ------------+-----+-----+----- 1 | x | | x ------------+-----+-----+----- 2 | | x | x ------------+-----+-----+----- 3 | x | x | ------------+-----+-----+----- 4 | x | | x

Does not guarantee order of op execution within a single global step.

Args:

  • global_step: Tensor indicating time. Determines which ops run.
  • thunks: List of thunks. Each thunk encapsulates one op. Return values are ignored.
  • batch_size: int. Number of ops to execute per global_step.
  • name: string or None. Name scope for newly added ops.

Returns:

List of ops. Exactly 'batch_size' ops are guaranteed to have an effect every global step.

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/kfac/utils/batch_execute