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

Function TEST

tensorflow/lite/delegates/gpu/common/model_builder_test.cc:32–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace {
31
32TEST(ModelBuilderTest, ConvertTfLiteTensorToTensorRefSucceedsForRank0) {
33 TfLiteTensor tflite_tensor;
34 tflite_tensor.name = "tensor_name";
35 tflite_tensor.type = TfLiteType::kTfLiteFloat32;
36 tflite_tensor.dims = TfLiteIntArrayCreate(1);
37 tflite_tensor.dims->data[0] = 4;
38 TensorRef<BHWC> tensor_ref;
39 const auto status =
40 ConvertTfLiteTensorToTensorRef(tflite_tensor, &tensor_ref);
41 TfLiteIntArrayFree(tflite_tensor.dims);
42 ASSERT_TRUE(status.ok());
43 EXPECT_EQ(tensor_ref.type, DataType::FLOAT32);
44 EXPECT_EQ(tensor_ref.shape, BHWC(4, 1, 1, 1));
45}
46
47TEST(ModelBuilderTest, ConvertTfLiteTensorToTensorRefSucceedsForRank1) {
48 TfLiteTensor tflite_tensor;

Callers

nothing calls this directly

Calls 9

TfLiteIntArrayCreateFunction · 0.85
TfLiteIntArrayFreeFunction · 0.85
GetOpsToReplaceFunction · 0.85
okMethod · 0.45
contextMethod · 0.45
GetSubgraphMethod · 0.45
exec_planMethod · 0.45

Tested by

no test coverage detected