Home | History | Annotate | Download | only in ops

Lines Matching defs:Barrier

915 class Barrier(object):
918 def __init__(self, types, shapes=None, shared_name=None, name="barrier"):
919 """Creates a barrier that persists across different graph executions.
921 A barrier represents a key-value map, where each key is a string, and
924 At runtime, the barrier contains 'complete' and 'incomplete'
930 The barrier call `take_many` outputs values in a particular order.
933 first component was inserted into the barrier. So, for example, for this
936 barrier = Barrier((tf.string, tf.int32), shapes=((), ()))
937 barrier.insert_many(0, keys=["k1", "k2"], values=["a", "b"]).run()
938 barrier.insert_many(1, keys=["k1"], values=[1]).run()
939 barrier.insert_many(0, keys=["k3"], values=["c"]).run()
940 barrier.insert_many(1, keys=["k3"], values=[3]).run()
941 barrier.insert_many(1, keys=["k2"], values=[2]).run()
943 (indices, keys, values) = barrier.take_many(2)
954 Note the key "k2" was inserted into the barrier before "k3". Even though
957 are returned first. "k3" remains in the barrier until the next execution
959 the barrier together, their indices are the same (-2**63). The index
964 dtypes of the tensor elements that comprise a value in this barrier.
967 for each barrier-element tuple component; or None if the shape should
969 shared_name: Optional. If non-empty, this barrier will be shared under
971 name: Optional name for the barrier op.
1000 """Get the underlying barrier reference."""
1005 """The name of the underlying barrier."""
1037 """Takes the given number of completed elements from this barrier.
1042 If barrier has no completed elements, this operation will block
1049 already when the barrier is closed, it will block for ever. Fix this
1054 allow_small_batch: If the barrier is closed, don't block if there are less
1066 the given element was inserted into the Barrier, starting with
1071 in the 0th dimension for each component in the barrier's values.
1085 # the Barrier object.
1102 """Closes this barrier.
1105 given barrier. Subsequent InsertMany operations with new keys will fail.
1108 continue to succeed if sufficient elements remain in the barrier. Subsequent
1121 The operation that closes the barrier.
1131 """Compute the number of complete elements in the given barrier.
1138 given barrier.
1145 """Compute the number of incomplete elements in the given barrier.
1152 the given barrier.