MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateConstArray

Function CreateConstArray

tensorflow/lite/toco/import_tensorflow.cc:530–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528
529template <ArrayDataType T>
530string 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//

Callers

nothing calls this directly

Calls 5

AvailableArrayNameFunction · 0.85
mutable_dimsMethod · 0.80
emplace_backMethod · 0.45
mutable_shapeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected