1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
8 #include "nnet_base_matcher.hpp"
9 #include "quantization/quantization.h"
11 class PoolingLayerMatcher : public ::testing::MatcherInterface<const intel_nnet_type_t*> {
16 PoolingLayerMatcher(bool matchInserted, int matchQuantity, bool bMaxPool)
17 : matchInserted(matchInserted), matchQuantity(matchQuantity), bMaxPool(bMaxPool) {}
18 bool MatchAndExplain(const intel_nnet_type_t *foo, ::testing::MatchResultListener *listener) const override {
21 for(int i = 0; i < foo->nLayers; i++) {
22 if (foo->pLayers[i].nLayerKind != INTEL_CONVOLUTIONAL) continue;
24 auto conv = (intel_convolutional_layer_t*)foo->pLayers[i].pLayerStruct;
25 if (conv->poolType != INTEL_MAX_POOLING) continue;
29 return !matchInserted;
31 void DescribeTo(::std::ostream *os) const override {
32 *os << "should "<< (matchInserted ? "" : "not ") << "have MaxPooling primitive as part of nnet structure";