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

Function MergeInferredShapes

tensorflow/compiler/jit/shape_inference.cc:209–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209xla::StatusOr<InferredShape> MergeInferredShapes(const InferredShape& a,
210 const InferredShape& b) {
211 InferredShape result;
212 TF_RETURN_IF_ERROR(a.shape.MergeWith(b.shape, &result.shape));
213
214 if (a.handle_type == DT_INVALID) {
215 result.handle_type = b.handle_type;
216 } else if (b.handle_type == DT_INVALID) {
217 result.handle_type = a.handle_type;
218 } else if (a.handle_type == b.handle_type) {
219 result.handle_type = a.handle_type;
220 } else {
221 return errors::InvalidArgument(
222 "Mismatched resource types: ", DataTypeString(a.handle_type), " vs. ",
223 DataTypeString(b.handle_type));
224 }
225 TF_RETURN_IF_ERROR(
226 a.handle_shape.MergeWith(b.handle_shape, &result.handle_shape));
227 return result;
228}
229
230} // namespace tensorflow

Callers

nothing calls this directly

Calls 3

InvalidArgumentFunction · 0.85
MergeWithMethod · 0.80
DataTypeStringFunction · 0.50

Tested by

no test coverage detected