/* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "Model.pb.h" #include "TestHarness.h" namespace android::nn::fuzz { namespace { using namespace test_helper; static_assert(static_cast(FLOAT32) == TestOperandType::FLOAT32); static_assert(static_cast(INT32) == TestOperandType::INT32); static_assert(static_cast(UINT32) == TestOperandType::UINT32); static_assert(static_cast(TENSOR_FLOAT32) == TestOperandType::TENSOR_FLOAT32); static_assert(static_cast(TENSOR_INT32) == TestOperandType::TENSOR_INT32); static_assert(static_cast(TENSOR_QUANT8_ASYMM) == TestOperandType::TENSOR_QUANT8_ASYMM); static_assert(static_cast(BOOL) == TestOperandType::BOOL); static_assert(static_cast(TENSOR_QUANT16_SYMM) == TestOperandType::TENSOR_QUANT16_SYMM); static_assert(static_cast(TENSOR_FLOAT16) == TestOperandType::TENSOR_FLOAT16); static_assert(static_cast(TENSOR_BOOL8) == TestOperandType::TENSOR_BOOL8); static_assert(static_cast(FLOAT16) == TestOperandType::FLOAT16); static_assert(static_cast(TENSOR_QUANT8_SYMM_PER_CHANNEL) == TestOperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL); static_assert(static_cast(TENSOR_QUANT16_ASYMM) == TestOperandType::TENSOR_QUANT16_ASYMM); static_assert(static_cast(TENSOR_QUANT8_SYMM) == TestOperandType::TENSOR_QUANT8_SYMM); static_assert(static_cast(TENSOR_QUANT8_ASYMM_SIGNED) == TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED); static_assert(static_cast(SUBGRAPH_OPERAND) == TestOperandType::SUBGRAPH); static_assert(static_cast(ADD) == TestOperationType::ADD); static_assert(static_cast(AVERAGE_POOL_2D) == TestOperationType::AVERAGE_POOL_2D); static_assert(static_cast(CONCATENATION) == TestOperationType::CONCATENATION); static_assert(static_cast(CONV_2D) == TestOperationType::CONV_2D); static_assert(static_cast(DEPTHWISE_CONV_2D) == TestOperationType::DEPTHWISE_CONV_2D); static_assert(static_cast(DEPTH_TO_SPACE) == TestOperationType::DEPTH_TO_SPACE); static_assert(static_cast(DEQUANTIZE) == TestOperationType::DEQUANTIZE); static_assert(static_cast(EMBEDDING_LOOKUP) == TestOperationType::EMBEDDING_LOOKUP); static_assert(static_cast(FLOOR) == TestOperationType::FLOOR); static_assert(static_cast(FULLY_CONNECTED) == TestOperationType::FULLY_CONNECTED); static_assert(static_cast(HASHTABLE_LOOKUP) == TestOperationType::HASHTABLE_LOOKUP); static_assert(static_cast(L2_NORMALIZATION) == TestOperationType::L2_NORMALIZATION); static_assert(static_cast(L2_POOL_2D) == TestOperationType::L2_POOL_2D); static_assert(static_cast(LOCAL_RESPONSE_NORMALIZATION) == TestOperationType::LOCAL_RESPONSE_NORMALIZATION); static_assert(static_cast(LOGISTIC) == TestOperationType::LOGISTIC); static_assert(static_cast(LSH_PROJECTION) == TestOperationType::LSH_PROJECTION); static_assert(static_cast(LSTM) == TestOperationType::LSTM); static_assert(static_cast(MAX_POOL_2D) == TestOperationType::MAX_POOL_2D); static_assert(static_cast(MUL) == TestOperationType::MUL); static_assert(static_cast(RELU) == TestOperationType::RELU); static_assert(static_cast(RELU1) == TestOperationType::RELU1); static_assert(static_cast(RELU6) == TestOperationType::RELU6); static_assert(static_cast(RESHAPE) == TestOperationType::RESHAPE); static_assert(static_cast(RESIZE_BILINEAR) == TestOperationType::RESIZE_BILINEAR); static_assert(static_cast(RNN) == TestOperationType::RNN); static_assert(static_cast(SOFTMAX) == TestOperationType::SOFTMAX); static_assert(static_cast(SPACE_TO_DEPTH) == TestOperationType::SPACE_TO_DEPTH); static_assert(static_cast(SVDF) == TestOperationType::SVDF); static_assert(static_cast(TANH) == TestOperationType::TANH); static_assert(static_cast(BATCH_TO_SPACE_ND) == TestOperationType::BATCH_TO_SPACE_ND); static_assert(static_cast(DIV) == TestOperationType::DIV); static_assert(static_cast(MEAN) == TestOperationType::MEAN); static_assert(static_cast(PAD) == TestOperationType::PAD); static_assert(static_cast(SPACE_TO_BATCH_ND) == TestOperationType::SPACE_TO_BATCH_ND); static_assert(static_cast(SQUEEZE) == TestOperationType::SQUEEZE); static_assert(static_cast(STRIDED_SLICE) == TestOperationType::STRIDED_SLICE); static_assert(static_cast(SUB) == TestOperationType::SUB); static_assert(static_cast(TRANSPOSE) == TestOperationType::TRANSPOSE); static_assert(static_cast(ABS) == TestOperationType::ABS); static_assert(static_cast(ARGMAX) == TestOperationType::ARGMAX); static_assert(static_cast(ARGMIN) == TestOperationType::ARGMIN); static_assert(static_cast(AXIS_ALIGNED_BBOX_TRANSFORM) == TestOperationType::AXIS_ALIGNED_BBOX_TRANSFORM); static_assert(static_cast(BIDIRECTIONAL_SEQUENCE_LSTM) == TestOperationType::BIDIRECTIONAL_SEQUENCE_LSTM); static_assert(static_cast(BIDIRECTIONAL_SEQUENCE_RNN) == TestOperationType::BIDIRECTIONAL_SEQUENCE_RNN); static_assert(static_cast(BOX_WITH_NMS_LIMIT) == TestOperationType::BOX_WITH_NMS_LIMIT); static_assert(static_cast(CAST) == TestOperationType::CAST); static_assert(static_cast(CHANNEL_SHUFFLE) == TestOperationType::CHANNEL_SHUFFLE); static_assert(static_cast(DETECTION_POSTPROCESSING) == TestOperationType::DETECTION_POSTPROCESSING); static_assert(static_cast(EQUAL) == TestOperationType::EQUAL); static_assert(static_cast(EXP) == TestOperationType::EXP); static_assert(static_cast(EXPAND_DIMS) == TestOperationType::EXPAND_DIMS); static_assert(static_cast(GATHER) == TestOperationType::GATHER); static_assert(static_cast(GENERATE_PROPOSALS) == TestOperationType::GENERATE_PROPOSALS); static_assert(static_cast(GREATER) == TestOperationType::GREATER); static_assert(static_cast(GREATER_EQUAL) == TestOperationType::GREATER_EQUAL); static_assert(static_cast(GROUPED_CONV_2D) == TestOperationType::GROUPED_CONV_2D); static_assert(static_cast(HEATMAP_MAX_KEYPOINT) == TestOperationType::HEATMAP_MAX_KEYPOINT); static_assert(static_cast(INSTANCE_NORMALIZATION) == TestOperationType::INSTANCE_NORMALIZATION); static_assert(static_cast(LESS) == TestOperationType::LESS); static_assert(static_cast(LESS_EQUAL) == TestOperationType::LESS_EQUAL); static_assert(static_cast(LOG) == TestOperationType::LOG); static_assert(static_cast(LOGICAL_AND) == TestOperationType::LOGICAL_AND); static_assert(static_cast(LOGICAL_NOT) == TestOperationType::LOGICAL_NOT); static_assert(static_cast(LOGICAL_OR) == TestOperationType::LOGICAL_OR); static_assert(static_cast(LOG_SOFTMAX) == TestOperationType::LOG_SOFTMAX); static_assert(static_cast(MAXIMUM) == TestOperationType::MAXIMUM); static_assert(static_cast(MINIMUM) == TestOperationType::MINIMUM); static_assert(static_cast(NEG) == TestOperationType::NEG); static_assert(static_cast(NOT_EQUAL) == TestOperationType::NOT_EQUAL); static_assert(static_cast(PAD_V2) == TestOperationType::PAD_V2); static_assert(static_cast(POW) == TestOperationType::POW); static_assert(static_cast(PRELU) == TestOperationType::PRELU); static_assert(static_cast(QUANTIZE) == TestOperationType::QUANTIZE); static_assert(static_cast(QUANTIZED_16BIT_LSTM) == TestOperationType::QUANTIZED_16BIT_LSTM); static_assert(static_cast(RANDOM_MULTINOMIAL) == TestOperationType::RANDOM_MULTINOMIAL); static_assert(static_cast(REDUCE_ALL) == TestOperationType::REDUCE_ALL); static_assert(static_cast(REDUCE_ANY) == TestOperationType::REDUCE_ANY); static_assert(static_cast(REDUCE_MAX) == TestOperationType::REDUCE_MAX); static_assert(static_cast(REDUCE_MIN) == TestOperationType::REDUCE_MIN); static_assert(static_cast(REDUCE_PROD) == TestOperationType::REDUCE_PROD); static_assert(static_cast(REDUCE_SUM) == TestOperationType::REDUCE_SUM); static_assert(static_cast(ROI_ALIGN) == TestOperationType::ROI_ALIGN); static_assert(static_cast(ROI_POOLING) == TestOperationType::ROI_POOLING); static_assert(static_cast(RSQRT) == TestOperationType::RSQRT); static_assert(static_cast(SELECT) == TestOperationType::SELECT); static_assert(static_cast(SIN) == TestOperationType::SIN); static_assert(static_cast(SLICE) == TestOperationType::SLICE); static_assert(static_cast(SPLIT) == TestOperationType::SPLIT); static_assert(static_cast(SQRT) == TestOperationType::SQRT); static_assert(static_cast(TILE) == TestOperationType::TILE); static_assert(static_cast(TOPK_V2) == TestOperationType::TOPK_V2); static_assert(static_cast(TRANSPOSE_CONV_2D) == TestOperationType::TRANSPOSE_CONV_2D); static_assert(static_cast(UNIDIRECTIONAL_SEQUENCE_LSTM) == TestOperationType::UNIDIRECTIONAL_SEQUENCE_LSTM); static_assert(static_cast(UNIDIRECTIONAL_SEQUENCE_RNN) == TestOperationType::UNIDIRECTIONAL_SEQUENCE_RNN); static_assert(static_cast(RESIZE_NEAREST_NEIGHBOR) == TestOperationType::RESIZE_NEAREST_NEIGHBOR); static_assert(static_cast(QUANTIZED_LSTM) == TestOperationType::QUANTIZED_LSTM); static_assert(static_cast(IF) == TestOperationType::IF); static_assert(static_cast(WHILE) == TestOperationType::WHILE); static_assert(static_cast(ELU) == TestOperationType::ELU); static_assert(static_cast(HARD_SWISH) == TestOperationType::HARD_SWISH); static_assert(static_cast(FILL) == TestOperationType::FILL); static_assert(static_cast(RANK) == TestOperationType::RANK); static_assert(static_cast(BATCH_MATMUL) == TestOperationType::BATCH_MATMUL); static_assert(static_cast(PACK) == TestOperationType::PACK); static_assert(static_cast(MIRROR_PAD) == TestOperationType::MIRROR_PAD); static_assert(static_cast(REVERSE) == TestOperationType::REVERSE); static_assert(static_cast(TEMPORARY_VARIABLE) == TestOperandLifeTime::TEMPORARY_VARIABLE); static_assert(static_cast(SUBGRAPH_INPUT) == TestOperandLifeTime::SUBGRAPH_INPUT); static_assert(static_cast(SUBGRAPH_OUTPUT) == TestOperandLifeTime::SUBGRAPH_OUTPUT); static_assert(static_cast(CONSTANT_COPY) == TestOperandLifeTime::CONSTANT_COPY); static_assert(static_cast(CONSTANT_REFERENCE) == TestOperandLifeTime::CONSTANT_REFERENCE); static_assert(static_cast(NO_VALUE) == TestOperandLifeTime::NO_VALUE); static_assert(static_cast(SUBGRAPH_LIFETIME) == TestOperandLifeTime::SUBGRAPH); } // anonymous namespace } // namespace android::nn::fuzz