MCPcopy Create free account
hub / github.com/Samsung/ONE / getEachByteSizeOf

Function getEachByteSizeOf

compiler/circle-eval-diff/src/InputDataLoader.cpp:52–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52std::vector<size_t> getEachByteSizeOf(const std::vector<loco::Node *> &nodes)
53{
54 std::vector<size_t> vec;
55
56 for (const auto node : nodes)
57 {
58 const auto input_node = loco::must_cast<const luci::CircleInput *>(node);
59 const auto dtype_size = luci::size(input_node->dtype());
60 size_t element_size = 1;
61
62 for (uint32_t index = 0; index < input_node->rank(); index++)
63 {
64 element_size *= input_node->dim(index).value();
65 }
66
67 vec.push_back(element_size * dtype_size);
68 }
69
70 return vec;
71}
72
73size_t getTotalByteSizeOf(const std::vector<loco::Node *> &nodes)
74{

Callers 1

getMethod · 0.85

Calls 6

push_backMethod · 0.80
sizeFunction · 0.50
dtypeMethod · 0.45
rankMethod · 0.45
valueMethod · 0.45
dimMethod · 0.45

Tested by

no test coverage detected