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

Function tensor_buffer_size

compiler/circle-inspect/src/Dump.cpp:74–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74size_t tensor_buffer_size(mio::circle::Reader &reader, const int32_t tensor_id)
75{
76 auto tensors = reader.tensors();
77
78 if (tensor_id < 0 || tensor_id >= tensors->size())
79 {
80 throw std::runtime_error("Invalid Tensor ID");
81 }
82
83 auto tensor = tensors->Get(tensor_id);
84 auto buffer_id = tensor->buffer();
85 bool ext_offset = false;
86
87 size_t size = reader.buffer_info(buffer_id, nullptr, ext_offset);
88
89 return size;
90}
91
92} // namespace
93

Callers 1

runMethod · 0.70

Calls 5

tensorsMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45
bufferMethod · 0.45
buffer_infoMethod · 0.45

Tested by

no test coverage detected