MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / insert_candidate

Method insert_candidate

imperative/src/impl/interpreter/interpreter_impl.cpp:1692–1702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1690}
1691
1692void ChannelImpl::DynamicSublinear::insert_candidate(TensorInfo* ptr) {
1693 // tensor to be inserted must be brand new
1694 mgb_assert(
1695 ptr->cand_index == UINT_MAX, "got wrong candidate index : %lu",
1696 ptr->cand_index);
1697 ptr->cand_index = candidates.size();
1698 candidates.push_back(ptr);
1699 if (!comp_node.valid()) {
1700 comp_node = ptr->ptr->comp_node();
1701 }
1702}
1703
1704void ChannelImpl::DynamicSublinear::erase_candidate(TensorInfo* ptr) {
1705 // close dtr will just clear candidates, so nothing to erase

Callers 1

produce_tensorMethod · 0.80

Calls 4

sizeMethod · 0.45
push_backMethod · 0.45
validMethod · 0.45
comp_nodeMethod · 0.45

Tested by

no test coverage detected