diff options
author | 2016-07-01 11:55:31 -0700 | |
---|---|---|
committer | 2016-07-01 11:55:31 -0700 | |
commit | 06fca4d9bc7ebff88493e105e4a1fe5002616469 (patch) | |
tree | e717d6a2e26d71455b0be40deedb1c11ab1eba0b /tensorflow/core/kernels/barrier_ops.cc | |
parent | 1c9e73a7a54413e205c9d0b127c61f0cb1adda34 (diff) | |
parent | de32f9237b5958f7a6951e79f2649572d29a1980 (diff) |
Merge pull request #3151 from rmlarsen/branch_126416482
Branch 126416482
Diffstat (limited to 'tensorflow/core/kernels/barrier_ops.cc')
-rw-r--r-- | tensorflow/core/kernels/barrier_ops.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/core/kernels/barrier_ops.cc b/tensorflow/core/kernels/barrier_ops.cc index 533b03db0e..e66b9d4168 100644 --- a/tensorflow/core/kernels/barrier_ops.cc +++ b/tensorflow/core/kernels/barrier_ops.cc @@ -354,7 +354,8 @@ class Barrier : public ResourceBase { element.push_back(PersistentTensor(uninitialized)); } } - if (element[1 + component_index].IsInitialized()) { + const PersistentTensor& component = element[1 + component_index]; + if (component.IsInitialized() && component.NumElements() > 0) { return errors::InvalidArgument("Key ", keys_vec(i), " already has a value for component ", component_index, " in barrier ", name()); @@ -374,7 +375,7 @@ class Barrier : public ResourceBase { // ready queue. bool is_complete = true; for (int j = 0; is_complete && j < element.size(); ++j) { - is_complete = element[j].IsInitialized(); + is_complete = element[j].IsInitialized() && element[j].NumElements() > 0; } if (is_complete) { // Add tuple to the ready queue. A queue tuple has the index |