MCPcopy Create free account
hub / github.com/OAID/Tengine / PopulateDynamicShape

Method PopulateDynamicShape

core/lib/graph.cpp:512–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512void Graph::PopulateDynamicShape(void)
513{
514 /* assume all the input nodes of a node are before the node in seq_nodes array */
515
516 int node_number = seq_nodes.size();
517
518 for(int i = 0; i < node_number; i++)
519 {
520 Node* node = seq_nodes[i];
521
522 bool dynamic_shape = node->IsDynamicShape();
523
524 if(dynamic_shape)
525 {
526 for(unsigned int n = 0; n < node->GetOutputNum(); n++)
527 {
528 NodePort* port = node->GetOutputPort(n);
529 Tensor* tensor = port->tensor;
530
531 for(unsigned int k = 0; k < tensor->consumer.size(); k++)
532 {
533 NodePort* in_port = tensor->consumer[k];
534 Node* child = in_port->owner;
535 child->SetDynamicShape(dynamic_shape);
536 }
537 }
538 }
539 }
540}
541
542void Graph::StripGraph(void)
543{

Callers

nothing calls this directly

Calls 5

IsDynamicShapeMethod · 0.80
GetOutputPortMethod · 0.80
sizeMethod · 0.45
GetOutputNumMethod · 0.45
SetDynamicShapeMethod · 0.45

Tested by

no test coverage detected