W3cubDocs

/TensorFlow Python

tf.contrib.kfac.op_queue.OpQueue

Class OpQueue

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

Class for choosing which Op to run next.

Constructs an infinitely repeating sequence of Ops in shuffled order.

In K-FAC, this can be used to distribute inverse update operations among workers.

Properties

ops

Ops this OpQueue can return in next_op().

Methods

__init__

__init__(
    ops,
    seed=None
)

Initializes an OpQueue.

Args:

  • ops: list of TensorFlow Ops. Ops to be selected from. All workers must initialize with the same set of ops.
  • seed: int or None. Random seed used when shuffling order of ops.

next_op

next_op(sess)

Chooses which op to run next.

Note: This call will make a call to sess.run().

Args:

  • sess: tf.Session.

Returns:

Next Op chosen from 'ops'.

© 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/op_queue/OpQueue