• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 #include "tensorflow/lite/c/builtin_op_data.h"
17 #include <gtest/gtest.h>
18 
19 namespace tflite {
20 
21 // Builtin op data is just a set of data definitions, so the only meaningful
22 // test we can run is whether we can create the structs we expect to find.
23 // Testing each struct's members might be possible, but it seems unnecessary
24 // until we've locked down the API. The build rule has copts set to ignore the
25 // unused variable warning, since this is just a compilation test.
TEST(IntArray,CanCompileStructs)26 TEST(IntArray, CanCompileStructs) {
27   TfLitePadding padding = kTfLitePaddingSame;
28   TfLitePaddingValues padding_values;
29   TfLiteFusedActivation fused_activation = kTfLiteActRelu;
30   TfLiteConvParams conv_params;
31   TfLitePoolParams pool_params;
32   TfLiteDepthwiseConvParams depthwise_conv_params;
33   TfLiteSVDFParams svdf_params;
34   TfLiteRNNParams rnn_params;
35   TfLiteSequenceRNNParams sequence_rnn_params;
36   TfLiteFullyConnectedWeightsFormat fully_connected_weights_format =
37       kTfLiteFullyConnectedWeightsFormatDefault;
38   TfLiteFullyConnectedParams fully_connected_params;
39   TfLiteLSHProjectionType projection_type = kTfLiteLshProjectionDense;
40   TfLiteLSHProjectionParams projection_params;
41   TfLiteSoftmaxParams softmax_params;
42   TfLiteConcatenationParams concatenation_params;
43   TfLiteAddParams add_params;
44   TfLiteSpaceToBatchNDParams space_to_batch_nd_params;
45   TfLiteBatchToSpaceNDParams batch_to_space_nd_params;
46   TfLiteMulParams mul_params;
47   TfLiteSubParams sub_params;
48   TfLiteDivParams div_params;
49   TfLiteL2NormParams l2_norm_params;
50   TfLiteLocalResponseNormParams local_response_norm_params;
51   TfLiteLSTMKernelType lstm_kernel_type = kTfLiteLSTMBasicKernel;
52   TfLiteLSTMParams lstm_params;
53   TfLiteResizeBilinearParams resize_bilinear_params;
54   TfLitePadParams pad_params;
55   TfLitePadV2Params pad_v2_params;
56   TfLiteReshapeParams reshape_params;
57   TfLiteSkipGramParams skip_gram_params;
58   TfLiteSpaceToDepthParams space_to_depth_params;
59   TfLiteCastParams cast_params;
60   TfLiteCombinerType combiner_type = kTfLiteCombinerTypeSqrtn;
61   TfLiteEmbeddingLookupSparseParams lookup_sparse_params;
62   TfLiteGatherParams gather_params;
63   TfLiteTransposeParams transpose_params;
64   TfLiteReducerParams reducer_params;
65   TfLiteSplitParams split_params;
66   TfLiteSplitVParams split_v_params;
67   TfLiteSqueezeParams squeeze_params;
68   TfLiteStridedSliceParams strided_slice_params;
69   TfLiteArgMaxParams arg_max_params;
70   TfLiteArgMinParams arg_min_params;
71   TfLiteTransposeConvParams transpose_conv_params;
72   TfLiteSparseToDenseParams sparse_to_dense_params;
73   TfLiteShapeParams shape_params;
74   TfLiteRankParams rank_params;
75   TfLiteFakeQuantParams fake_quant_params;
76   TfLitePackParams pack_params;
77   TfLiteOneHotParams one_hot_params;
78   TfLiteBidirectionalSequenceRNNParams bidi_sequence_rnn_params;
79   TfLiteBidirectionalSequenceLSTMParams bidi_sequence_lstm_params;
80 }
81 
82 }  // namespace tflite
83 
main(int argc,char ** argv)84 int main(int argc, char** argv) {
85   ::testing::InitGoogleTest(&argc, argv);
86   return RUN_ALL_TESTS();
87 }
88