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

Function CreateInt32Array

tensorflow/lite/toco/tooling_util.cc:1871–1884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1869}
1870
1871string CreateInt32Array(Model* model, const string& param_name,
1872 const std::vector<int>& value) {
1873 auto param_array_name = AvailableArrayName(*model, param_name);
1874 auto& param_array = model->GetOrCreateArray(param_array_name);
1875 param_array.mutable_shape()->ReplaceDims({static_cast<int>(value.size())});
1876 param_array.data_type = ArrayDataType::kInt32;
1877 auto& param_array_data =
1878 param_array.GetMutableBuffer<ArrayDataType::kInt32>().data;
1879 param_array_data.resize(RequiredBufferSizeForShape(param_array.shape()));
1880 for (int i = 0; i < value.size(); ++i) {
1881 param_array_data[i] = value[i];
1882 }
1883 return param_array_name;
1884}
1885
1886bool EstimateArithmeticOpsCount(const Model& model, const Operator& op,
1887 int64* result) {

Callers 6

InsertCopyOperatorFunction · 0.85
RunMethod · 0.85
SliceInputFunction · 0.85
TransposeInputFunction · 0.85
RunMethod · 0.85
RunMethod · 0.85

Calls 7

AvailableArrayNameFunction · 0.85
ReplaceDimsMethod · 0.80
mutable_shapeMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected