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

Function CheckIntTensor

tensorflow/lite/kernels/subgraph_test_util.cc:374–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374void CheckIntTensor(const TfLiteTensor* tensor, const std::vector<int>& shape,
375 const std::vector<int32_t>& data) {
376 ASSERT_EQ(tensor->dims->size, shape.size());
377 for (int i = 0; i < tensor->dims->size; ++i) {
378 ASSERT_EQ(tensor->dims->data[i], shape[i]);
379 }
380 ASSERT_EQ(tensor->type, kTfLiteInt32);
381 int count = NumElements(tensor);
382 ASSERT_EQ(count, data.size());
383 for (int i = 0; i < count; ++i) {
384 EXPECT_EQ(tensor->data.i32[i], data[i]);
385 }
386}
387
388void CheckBoolTensor(const TfLiteTensor* tensor, const std::vector<int>& shape,
389 const std::vector<bool>& data) {

Callers 4

TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 2

NumElementsFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected