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

Method SetWeights

tensorflow/lite/kernels/lstm_test.cc:297–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295 }
296
297 void SetWeights(int index, const std::vector<float>& data) {
298 if (data.empty()) return;
299 if (index == kOptionalTensor) return;
300 switch (weight_type_) {
301 case TensorType_FLOAT32:
302 PopulateTensor(index, data);
303 break;
304 case TensorType_UINT8:
305 SymmetricQuantizeAndPopulate(index, data);
306 break;
307 case TensorType_INT8:
308 SignedSymmetricQuantizeAndPopulate(index, data);
309 break;
310 default:
311 GTEST_FAIL() << "Type not supported: " << weight_type_;
312 break;
313 }
314 }
315
316 const TensorType weight_type_;
317 const bool is_layer_norm_;

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected