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

Method UpdateShapes

tensorflow/core/grappler/costs/graph_properties.cc:1960–1986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1958}
1959
1960Status GraphProperties::UpdateShapes(
1961 SymbolicShapeRefiner* shape_refiner,
1962 const std::unordered_map<const NodeDef*, const NodeDef*>& resource_handles,
1963 const NodeDef* n, bool* new_shapes) const {
1964 if (IsEnter(*n)) {
1965 // The Enter shape function always forwards an UnknownShape, so do the right
1966 // thing here.
1967 TF_RETURN_IF_ERROR(UpdateEnter(shape_refiner, n, new_shapes));
1968 } else if (IsMerge(*n)) {
1969 // Properly handle merge nodes.
1970 TF_RETURN_IF_ERROR(UpdateMerge(shape_refiner, n, new_shapes));
1971 } else if (IsEnqueue(*n)) {
1972 // Make sure the shapes of enqueued tensors are propagated to the queue
1973 // itself.
1974 TF_RETURN_IF_ERROR(
1975 UpdateEnqueue(n, resource_handles, shape_refiner, new_shapes));
1976 } else if (IsQueue(*n)) {
1977 // Set shapes and types of Queue ops, if needed.
1978 TF_RETURN_IF_ERROR(UpdateQueue(n, shape_refiner, new_shapes));
1979 } else {
1980 // Rely on regular TF shape refinement for all the other nodes.
1981 // UpdateNode calls UpdateFunction if a function node is detected.
1982 TF_RETURN_IF_ERROR(shape_refiner->UpdateNode(n, new_shapes));
1983 }
1984
1985 return Status::OK();
1986}
1987
1988// Propagates the shapes in the transitive fan-out of <new_shapes>.
1989Status GraphProperties::PropagateShapes(

Callers

nothing calls this directly

Calls 5

IsEnqueueFunction · 0.85
IsQueueFunction · 0.85
IsEnterFunction · 0.50
IsMergeFunction · 0.50
UpdateNodeMethod · 0.45

Tested by

no test coverage detected