TODO(mrry): If these checks become a bottleneck, find a way to reduce the number of times that they are called.
| 142 | // TODO(mrry): If these checks become a bottleneck, find a way to |
| 143 | // reduce the number of times that they are called. |
| 144 | Status QueueBase::ValidateTuple(const Tuple& tuple) { |
| 145 | TF_RETURN_IF_ERROR(ValidateTupleCommon(tuple)); |
| 146 | if (specified_shapes()) { |
| 147 | for (size_t i = 0; i < tuple.size(); ++i) { |
| 148 | if (!component_shapes_[i].IsSameSize(tuple[i].shape())) { |
| 149 | return errors::InvalidArgument( |
| 150 | "Shape mismatch in tuple component ", i, ". Expected ", |
| 151 | component_shapes_[i].DebugString(), ", got ", |
| 152 | tuple[i].shape().DebugString()); |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | return Status::OK(); |
| 157 | } |
| 158 | |
| 159 | // TODO(mrry): If these checks become a bottleneck, find a way to |
| 160 | // reduce the number of times that they are called. |
no test coverage detected