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

Function find_index

imperative/src/impl/proxy_graph/mini_graph.h:20–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19template <typename C, typename E>
20std::pair<bool, size_t> find_index(const C& container, const E& item) {
21 auto&& it = std::find(container.begin(), container.end(), item);
22 return {it != container.end(), it - container.begin()};
23}
24
25template <typename T, typename = void>
26class TensorAdaptor;

Callers 5

initializeMethod · 0.85
MiniGraphMethod · 0.85
register_shape_inferMethod · 0.85
register_value_inferMethod · 0.85
InferSessionClass · 0.85

Calls 3

findFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected