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

Method ResetTensor

tensorflow/lite/testing/tf_driver.cc:194–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194void TfDriver::ResetTensor(int id) {
195 if (!IsValid()) return;
196 auto tensor = input_tensors_[input_names_[id]];
197 switch (input_types_[id]) {
198 case tensorflow::DT_FLOAT: {
199 FillTensorWithZeros<float>(&tensor);
200 break;
201 }
202 case tensorflow::DT_INT32: {
203 FillTensorWithZeros<int32_t>(&tensor);
204 break;
205 }
206 default:
207 Invalidate(absl::StrCat("Unsupported tensor type ", input_types_[id],
208 tensorflow::DataType_Name(input_types_[id]),
209 " in ResetInput"));
210 return;
211 }
212}
213
214void TfDriver::ReshapeTensor(int id, const string& values_as_string) {
215 input_shapes_[id] = Split<int64_t>(values_as_string, ",");

Callers 3

SetFieldMethod · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 2

IsValidFunction · 0.85
StrCatFunction · 0.50

Tested by 3

SetFieldMethod · 0.36
TESTFunction · 0.36
TESTFunction · 0.36