152 auto graph = context->
graph();
153 auto reader = context->
reader();
154 const auto tensors = reader->
tensors();
163 const auto r_buffers = reader->buffers();
170 throw std::runtime_error(
"CircleConst: Circle file with invalid extended Buffer.");
178 if (
r_buffer->size() >= std::numeric_limits<uint32_t>::max())
181 throw std::runtime_error(
"CircleConst: Circle file with invalid extended Buffer.");
236 if (buffer.
empty() && num_elements > 0)
242 auto const_node = graph->nodes()->create<
CircleConst>();
245 INFO(l) <<
"[luci] NodeFinder const_node(" <<
tensor_index <<
") -> " << const_node <<
" "
247 if (num_elements > 0)
251 case loco::DataType::FLOAT32:
255 case loco::DataType::FLOAT16:
259 case loco::DataType::U4:
263 case loco::DataType::U8:
267 case loco::DataType::S4:
271 case loco::DataType::S8:
275 case loco::DataType::S16:
279 case loco::DataType::S32:
283 case loco::DataType::S64:
287 case loco::DataType::BOOL:
291 case loco::DataType::STRING:
Class to store context to build loco graph IR from TensorFlow.
IndexTensorOutputs * tensoroutputs()
void copy_tensor_attributes(const circle::Tensor *tensor, CircleNode *node)
Copy common tensor attributes such as name, type, etc. to node.