MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ValidateTuple

Method ValidateTuple

tensorflow/core/kernels/queue_base.cc:144–157  ·  view source on GitHub ↗

TODO(mrry): If these checks become a bottleneck, find a way to reduce the number of times that they are called.

Source from the content-addressed store, hash-verified

142// TODO(mrry): If these checks become a bottleneck, find a way to
143// reduce the number of times that they are called.
144Status 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.

Callers 2

ComputeAsyncMethod · 0.45

Calls 6

specified_shapesFunction · 0.85
InvalidArgumentFunction · 0.85
sizeMethod · 0.45
IsSameSizeMethod · 0.45
shapeMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected