| 528 | |
| 529 | template <ArrayDataType T> |
| 530 | string CreateConstArray(Model* model, string const& name, |
| 531 | std::vector<typename toco::DataType<T> > const& data) { |
| 532 | // Utility function to create a const 1D array, useful for input parameters. |
| 533 | string array_name = toco::AvailableArrayName(*model, name); |
| 534 | auto& array = model->GetOrCreateArray(array_name); |
| 535 | array.data_type = T; |
| 536 | array.mutable_shape()->mutable_dims()->emplace_back(data.size()); |
| 537 | array.GetMutableBuffer<T>().data = data; |
| 538 | return array_name; |
| 539 | } |
| 540 | |
| 541 | // Retain TensorFlow NodeDef in Toco Operator. |
| 542 | // |
nothing calls this directly
no test coverage detected