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

Function CheckBoolTensor

tensorflow/lite/kernels/subgraph_test_util.cc:388–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388void CheckBoolTensor(const TfLiteTensor* tensor, const std::vector<int>& shape,
389 const std::vector<bool>& data) {
390 ASSERT_EQ(tensor->dims->size, shape.size());
391 for (int i = 0; i < tensor->dims->size; ++i) {
392 ASSERT_EQ(tensor->dims->data[i], shape[i]);
393 }
394 ASSERT_EQ(tensor->type, kTfLiteBool);
395 int count = NumElements(tensor);
396 ASSERT_EQ(count, data.size());
397 for (int i = 0; i < count; ++i) {
398 EXPECT_EQ(tensor->data.b[i], data[i]);
399 }
400}
401
402} // namespace subgraph_test_util
403} // namespace tflite

Callers 1

TEST_FFunction · 0.85

Calls 2

NumElementsFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected