Split CNNlayer validators (#1403)
* Simplified CNNLayer validators: keep only parsing of arguments * Added validators as is * Removed parsing arguments * Removed Backetize validator
This commit is contained in:
parent
a482e32911
commit
14d371849d
@ -198,7 +198,7 @@ public:
|
||||
/**
|
||||
* @brief Checks if the input data and layer data are legitimate
|
||||
*/
|
||||
void validateLayer();
|
||||
void parseParams();
|
||||
|
||||
/**
|
||||
* @brief Parse string with float in accordance with IE rules
|
||||
|
@ -913,7 +913,7 @@ void convertFunctionToICNNNetwork(const std::shared_ptr<const ::ngraph::Function
|
||||
|
||||
// execution ngraph is fake graph and should not be validated
|
||||
if (layer->params.count(ExecGraphInfoSerialization::PERF_COUNTER) == 0) {
|
||||
layer->validateLayer();
|
||||
layer->parseParams();
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,11 +15,6 @@
|
||||
namespace InferenceEngine {
|
||||
namespace details {
|
||||
|
||||
struct InOutDims {
|
||||
std::vector<std::vector<size_t>> inDims;
|
||||
std::vector<std::vector<size_t>> outDims;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Contains methods to validate layer of specific type
|
||||
*/
|
||||
@ -37,28 +32,6 @@ public:
|
||||
*/
|
||||
virtual void parseParams(CNNLayer* layer) {}
|
||||
|
||||
/**
|
||||
* @brief Validates layer parameters separately from blobs and shapes
|
||||
* This is semantic check, like height and width more than kernel sizes, stride > 0, beta > 0, axis is correct and
|
||||
* etc Throws exception if the check fails
|
||||
*/
|
||||
virtual void checkParams(const CNNLayer* layer) {}
|
||||
|
||||
/**
|
||||
* @brief Checks correspondence of input shapes and layer parameters.
|
||||
* @note: This function doesn't touch ins and out Data of the layer.
|
||||
* Throws exception if the check fails
|
||||
*/
|
||||
virtual void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const {}
|
||||
|
||||
/**
|
||||
* @brief Checks correspondence of all parameters in the aggregate, except output shapes.
|
||||
* @note: This function doesn't touch ins and out Data of the layer.
|
||||
* Throws exception if the check fails
|
||||
*/
|
||||
virtual void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const {}
|
||||
|
||||
protected:
|
||||
std::string _type;
|
||||
};
|
||||
@ -83,24 +56,6 @@ private:
|
||||
InferenceEngine::details::caseless_unordered_map<std::string, LayerValidator::Ptr> _validators;
|
||||
};
|
||||
|
||||
inline static void getInOutShapes(const CNNLayer* layer, InOutDims& inOutShapes) {
|
||||
inOutShapes.inDims.clear();
|
||||
inOutShapes.outDims.clear();
|
||||
if (layer) {
|
||||
for (const auto& inData : layer->insData) {
|
||||
auto locked = inData.lock();
|
||||
if (locked) {
|
||||
inOutShapes.inDims.push_back(locked->getDims());
|
||||
}
|
||||
}
|
||||
for (const auto& outData : layer->outData) {
|
||||
if (outData) {
|
||||
inOutShapes.outDims.push_back(outData->getDims());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GeneralValidator : public LayerValidator {
|
||||
public:
|
||||
explicit GeneralValidator(const std::string& _type);
|
||||
@ -110,52 +65,27 @@ class ConvolutionValidator : public LayerValidator {
|
||||
public:
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
explicit ConvolutionValidator(const std::string& _type);
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class DeconvolutionValidator : public ConvolutionValidator {
|
||||
public:
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
explicit DeconvolutionValidator(const std::string& _type);
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class DeformableConvolutionValidator : public ConvolutionValidator {
|
||||
public:
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
explicit DeformableConvolutionValidator(const std::string& _type);
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PoolingValidator : public LayerValidator {
|
||||
public:
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
explicit PoolingValidator(const std::string& _type);
|
||||
};
|
||||
|
||||
@ -164,13 +94,6 @@ public:
|
||||
explicit FullyConnectedValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class CropValidator : public LayerValidator {
|
||||
@ -178,10 +101,6 @@ public:
|
||||
explicit CropValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class TileValidator : public LayerValidator {
|
||||
@ -189,10 +108,6 @@ public:
|
||||
explicit TileValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BatchNormalizationValidator : public LayerValidator {
|
||||
@ -200,10 +115,6 @@ public:
|
||||
explicit BatchNormalizationValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PowerValidator : public LayerValidator {
|
||||
@ -211,10 +122,6 @@ public:
|
||||
explicit PowerValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PReLUValidator : public LayerValidator {
|
||||
@ -222,30 +129,19 @@ public:
|
||||
explicit PReLUValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ScaleShiftValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ScaleShiftValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
void parseParams(CNNLayer* layer) override;};
|
||||
|
||||
class ReshapeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ReshapeValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
};
|
||||
|
||||
class EltwiseValidator : public LayerValidator {
|
||||
@ -253,10 +149,6 @@ public:
|
||||
explicit EltwiseValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ClampValidator : public LayerValidator {
|
||||
@ -264,8 +156,6 @@ public:
|
||||
explicit ClampValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReLUValidator : public LayerValidator {
|
||||
@ -273,10 +163,6 @@ public:
|
||||
explicit ReLUValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class MVNValidator : public LayerValidator {
|
||||
@ -284,10 +170,6 @@ public:
|
||||
explicit MVNValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class GRNValidator : public LayerValidator {
|
||||
@ -295,10 +177,6 @@ public:
|
||||
explicit GRNValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SoftMaxValidator : public LayerValidator {
|
||||
@ -306,10 +184,6 @@ public:
|
||||
explicit SoftMaxValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class NormValidator : public LayerValidator {
|
||||
@ -317,10 +191,6 @@ public:
|
||||
explicit NormValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SplitValidator : public LayerValidator {
|
||||
@ -328,10 +198,6 @@ public:
|
||||
explicit SplitValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ConcatValidator : public LayerValidator {
|
||||
@ -339,10 +205,6 @@ public:
|
||||
explicit ConcatValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class GemmValidator : public LayerValidator {
|
||||
@ -350,10 +212,6 @@ public:
|
||||
explicit GemmValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PadValidator : public LayerValidator {
|
||||
@ -361,10 +219,6 @@ public:
|
||||
explicit PadValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class GatherValidator : public LayerValidator {
|
||||
@ -372,10 +226,6 @@ public:
|
||||
explicit GatherValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class StridedSliceValidator : public LayerValidator {
|
||||
@ -383,10 +233,6 @@ public:
|
||||
explicit StridedSliceValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ShuffleChannelsValidator : public LayerValidator {
|
||||
@ -394,10 +240,6 @@ public:
|
||||
explicit ShuffleChannelsValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class DepthToSpaceValidator : public LayerValidator {
|
||||
@ -405,10 +247,6 @@ public:
|
||||
explicit DepthToSpaceValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SpaceToDepthValidator : public LayerValidator {
|
||||
@ -416,10 +254,6 @@ public:
|
||||
explicit SpaceToDepthValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SpaceToBatchValidator : public LayerValidator {
|
||||
@ -427,10 +261,6 @@ public:
|
||||
explicit SpaceToBatchValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BatchToSpaceValidator : public LayerValidator {
|
||||
@ -438,10 +268,6 @@ public:
|
||||
explicit BatchToSpaceValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SparseFillEmptyRowsValidator : public LayerValidator {
|
||||
@ -449,43 +275,6 @@ public:
|
||||
explicit SparseFillEmptyRowsValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SparseSegmentReduceValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SparseSegmentReduceValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ExperimentalSparseWeightedReduceValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ExperimentalSparseWeightedReduceValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SparseToDenseValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SparseToDenseValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BucketizeValidator : public LayerValidator {
|
||||
@ -493,10 +282,6 @@ public:
|
||||
explicit BucketizeValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReverseSequenceValidator : public LayerValidator {
|
||||
@ -504,65 +289,6 @@ public:
|
||||
explicit ReverseSequenceValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SqueezeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SqueezeValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class UnsqueezeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit UnsqueezeValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class RangeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit RangeValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class FillValidator : public LayerValidator {
|
||||
public:
|
||||
explicit FillValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BroadcastValidator : public LayerValidator {
|
||||
public:
|
||||
explicit BroadcastValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class RNNBaseValidator : public LayerValidator {
|
||||
@ -570,12 +296,6 @@ public:
|
||||
RNNBaseValidator(const std::string& _type, RNNSequenceLayer::CellType CELL);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
protected:
|
||||
std::vector<std::string> def_acts; // Default values for cell gate activations
|
||||
std::vector<float> def_alpha; // Default activation alpha parameter
|
||||
@ -588,8 +308,6 @@ template <RNNSequenceLayer::CellType CELL>
|
||||
class RNNCellValidator : public RNNBaseValidator {
|
||||
public:
|
||||
explicit RNNCellValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
extern template class RNNCellValidator<RNNSequenceLayer::LSTM>;
|
||||
@ -602,81 +320,17 @@ public:
|
||||
explicit RNNSequenceValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
extern template class RNNSequenceValidator<RNNSequenceLayer::LSTM>;
|
||||
extern template class RNNSequenceValidator<RNNSequenceLayer::GRU>;
|
||||
extern template class RNNSequenceValidator<RNNSequenceLayer::RNN>;
|
||||
|
||||
class ArgMaxValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ArgMaxValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class CTCGreedyDecoderValidator : public LayerValidator {
|
||||
public:
|
||||
explicit CTCGreedyDecoderValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class DetectionOutputValidator : public LayerValidator {
|
||||
public:
|
||||
explicit DetectionOutputValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class InterpValidator : public LayerValidator {
|
||||
public:
|
||||
explicit InterpValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PermuteValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PermuteValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PriorBoxValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PriorBoxValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PriorBoxClusteredValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PriorBoxClusteredValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ProposalValidator : public LayerValidator {
|
||||
@ -684,73 +338,6 @@ public:
|
||||
explicit ProposalValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PSROIPoolingValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PSROIPoolingValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class RegionYoloValidator : public LayerValidator {
|
||||
public:
|
||||
explicit RegionYoloValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReorgYoloValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ReorgYoloValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ResampleValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ResampleValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ROIPoolingValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ROIPoolingValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SimplerNMSValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SimplerNMSValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SpatialTransformerValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SpatialTransformerValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class OneHotValidator : public LayerValidator {
|
||||
@ -758,125 +345,6 @@ public:
|
||||
explicit OneHotValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class UpsamplingValidator : public LayerValidator {
|
||||
public:
|
||||
explicit UpsamplingValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ActivationValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ActivationValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ConstValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ConstValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ELUValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ELUValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class InputValidator : public LayerValidator {
|
||||
public:
|
||||
explicit InputValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class MemoryValidator : public LayerValidator {
|
||||
public:
|
||||
explicit MemoryValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class NormalizeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit NormalizeValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class CopyValidator : public LayerValidator {
|
||||
public:
|
||||
explicit CopyValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PowerFileValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PowerFileValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReLU6Validator : public LayerValidator {
|
||||
public:
|
||||
explicit ReLU6Validator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SigmoidValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SigmoidValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class TanHValidator : public LayerValidator {
|
||||
public:
|
||||
explicit TanHValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class UnpoolingValidator : public LayerValidator {
|
||||
public:
|
||||
explicit UnpoolingValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class QuantizeValidator : public LayerValidator {
|
||||
@ -884,38 +352,13 @@ public:
|
||||
explicit QuantizeValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BinaryConvolutionValidator : public LayerValidator {
|
||||
public:
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
explicit BinaryConvolutionValidator(const std::string& _type);
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SelectValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SelectValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class MathValidator : public LayerValidator {
|
||||
public:
|
||||
explicit MathValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReduceValidator : public LayerValidator {
|
||||
@ -923,21 +366,6 @@ public:
|
||||
explicit ReduceValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class GatherTreeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit GatherTreeValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class TopKValidator : public LayerValidator {
|
||||
@ -945,8 +373,6 @@ public:
|
||||
explicit TopKValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class UniqueValidator : public LayerValidator {
|
||||
@ -954,8 +380,6 @@ public:
|
||||
explicit UniqueValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class NMSValidator : public LayerValidator {
|
||||
@ -963,10 +387,6 @@ public:
|
||||
explicit NMSValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ScatterUpdateValidator : public LayerValidator {
|
||||
@ -974,8 +394,6 @@ public:
|
||||
explicit ScatterUpdateValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ScatterElementsUpdateValidator : public LayerValidator {
|
||||
@ -983,8 +401,6 @@ public:
|
||||
explicit ScatterElementsUpdateValidator(const std::string& _type);
|
||||
|
||||
void parseParams(CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
} // namespace details
|
||||
|
@ -37,9 +37,6 @@ public:
|
||||
void validate(CNNLayer* layer, const std::vector<Blob::CPtr>& inBlobs,
|
||||
const std::map<std::string, std::string>& params, const std::map<std::string, Blob::Ptr>& blobs) {
|
||||
_validator->parseParams(layer);
|
||||
_validator->checkParams(layer);
|
||||
_validator->checkShapes(layer, inShapes);
|
||||
_validator->checkCorrespondence(layer, blobs, inShapes);
|
||||
}
|
||||
|
||||
virtual void inferShapesImpl(const std::vector<Blob::CPtr>& inBlobs,
|
||||
|
@ -32,7 +32,6 @@ public:
|
||||
layer.params = params;
|
||||
layer.type = _type;
|
||||
_validator->parseParams(&layer);
|
||||
_validator->checkParams(&layer);
|
||||
auto src_dims = inData[0]->getTensorDesc().getDims();
|
||||
|
||||
const auto* src_data = inData[0]->cbuffer().as<const T*>();
|
||||
@ -63,7 +62,6 @@ public:
|
||||
layer.params = params;
|
||||
layer.type = _type;
|
||||
_validator->parseParams(&layer);
|
||||
_validator->checkParams(&layer);
|
||||
auto src_dims = inData[0]->getTensorDesc().getDims();
|
||||
|
||||
const auto* src_data = inData[0]->cbuffer().as<const int16_t*>();
|
||||
|
@ -3,6 +3,7 @@
|
||||
//
|
||||
|
||||
#include "ie_format_parser.h"
|
||||
#include "ie_layer_validators.hpp"
|
||||
|
||||
#include <fstream>
|
||||
#include <set>
|
||||
@ -432,7 +433,8 @@ CNNNetworkImplPtr FormatParser::Parse(pugi::xml_node& root) {
|
||||
<< parseInfo.inputPorts[i].portId << " is not connected to any data";
|
||||
}
|
||||
}
|
||||
layer->validateLayer();
|
||||
layer->parseParams();
|
||||
details::validateLayer(layer.get());
|
||||
}
|
||||
// parse mean image
|
||||
ParsePreProcess(root);
|
||||
|
2352
inference-engine/src/readers/ir_reader_v7/ie_layer_validators.cpp
Normal file
2352
inference-engine/src/readers/ir_reader_v7/ie_layer_validators.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,874 @@
|
||||
// Copyright (C) 2018-2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "details/caseless.hpp"
|
||||
#include "ie_layers.h"
|
||||
|
||||
namespace InferenceEngine {
|
||||
namespace details {
|
||||
|
||||
struct InOutDims {
|
||||
std::vector<std::vector<size_t>> inDims;
|
||||
std::vector<std::vector<size_t>> outDims;
|
||||
};
|
||||
|
||||
void validateLayer(const CNNLayer * layer);
|
||||
|
||||
/**
|
||||
* @brief Contains methods to validate layer of specific type
|
||||
*/
|
||||
class LayerValidator {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<LayerValidator>;
|
||||
|
||||
explicit LayerValidator(const std::string& _type): _type(_type) {}
|
||||
virtual ~LayerValidator() = default;
|
||||
|
||||
/**
|
||||
* @brief Validates layer parameters separately from blobs and shapes
|
||||
* This is semantic check, like height and width more than kernel sizes, stride > 0, beta > 0, axis is correct and
|
||||
* etc Throws exception if the check fails
|
||||
*/
|
||||
virtual void checkParams(const CNNLayer* layer) {}
|
||||
|
||||
/**
|
||||
* @brief Checks correspondence of input shapes and layer parameters.
|
||||
* @note: This function doesn't touch ins and out Data of the layer.
|
||||
* Throws exception if the check fails
|
||||
*/
|
||||
virtual void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const {}
|
||||
|
||||
/**
|
||||
* @brief Checks correspondence of all parameters in the aggregate, except output shapes.
|
||||
* @note: This function doesn't touch ins and out Data of the layer.
|
||||
* Throws exception if the check fails
|
||||
*/
|
||||
virtual void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const {}
|
||||
|
||||
protected:
|
||||
std::string _type;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Contains all validators, registered for specific layer type
|
||||
*/
|
||||
class LayerValidators {
|
||||
public:
|
||||
static LayerValidators* getInstance();
|
||||
|
||||
LayerValidators(LayerValidators const&) = delete;
|
||||
|
||||
void operator=(LayerValidators const&) = delete;
|
||||
|
||||
LayerValidator::Ptr getValidator(const std::string& type);
|
||||
|
||||
private:
|
||||
LayerValidators();
|
||||
|
||||
private:
|
||||
InferenceEngine::details::caseless_unordered_map<std::string, LayerValidator::Ptr> _validators;
|
||||
};
|
||||
|
||||
inline static void getInOutShapes(const CNNLayer* layer, InOutDims& inOutShapes) {
|
||||
inOutShapes.inDims.clear();
|
||||
inOutShapes.outDims.clear();
|
||||
if (layer) {
|
||||
for (const auto& inData : layer->insData) {
|
||||
auto locked = inData.lock();
|
||||
if (locked) {
|
||||
inOutShapes.inDims.push_back(locked->getDims());
|
||||
}
|
||||
}
|
||||
for (const auto& outData : layer->outData) {
|
||||
if (outData) {
|
||||
inOutShapes.outDims.push_back(outData->getDims());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GeneralValidator : public LayerValidator {
|
||||
public:
|
||||
explicit GeneralValidator(const std::string& _type);
|
||||
};
|
||||
|
||||
class ConvolutionValidator : public LayerValidator {
|
||||
public:
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
explicit ConvolutionValidator(const std::string& _type);
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class DeconvolutionValidator : public ConvolutionValidator {
|
||||
public:
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
explicit DeconvolutionValidator(const std::string& _type);
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class DeformableConvolutionValidator : public ConvolutionValidator {
|
||||
public:
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
explicit DeformableConvolutionValidator(const std::string& _type);
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PoolingValidator : public LayerValidator {
|
||||
public:
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
explicit PoolingValidator(const std::string& _type);
|
||||
};
|
||||
|
||||
class FullyConnectedValidator : public LayerValidator {
|
||||
public:
|
||||
explicit FullyConnectedValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class CropValidator : public LayerValidator {
|
||||
public:
|
||||
explicit CropValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class TileValidator : public LayerValidator {
|
||||
public:
|
||||
explicit TileValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BatchNormalizationValidator : public LayerValidator {
|
||||
public:
|
||||
explicit BatchNormalizationValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PowerValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PowerValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PReLUValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PReLUValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ScaleShiftValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ScaleShiftValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReshapeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ReshapeValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
};
|
||||
|
||||
class EltwiseValidator : public LayerValidator {
|
||||
public:
|
||||
explicit EltwiseValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ClampValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ClampValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReLUValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ReLUValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class MVNValidator : public LayerValidator {
|
||||
public:
|
||||
explicit MVNValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class GRNValidator : public LayerValidator {
|
||||
public:
|
||||
explicit GRNValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SoftMaxValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SoftMaxValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class NormValidator : public LayerValidator {
|
||||
public:
|
||||
explicit NormValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SplitValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SplitValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ConcatValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ConcatValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class GemmValidator : public LayerValidator {
|
||||
public:
|
||||
explicit GemmValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PadValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PadValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class GatherValidator : public LayerValidator {
|
||||
public:
|
||||
explicit GatherValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class StridedSliceValidator : public LayerValidator {
|
||||
public:
|
||||
explicit StridedSliceValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ShuffleChannelsValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ShuffleChannelsValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class DepthToSpaceValidator : public LayerValidator {
|
||||
public:
|
||||
explicit DepthToSpaceValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SpaceToDepthValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SpaceToDepthValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SpaceToBatchValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SpaceToBatchValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BatchToSpaceValidator : public LayerValidator {
|
||||
public:
|
||||
explicit BatchToSpaceValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SparseFillEmptyRowsValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SparseFillEmptyRowsValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SparseSegmentReduceValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SparseSegmentReduceValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ExperimentalSparseWeightedReduceValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ExperimentalSparseWeightedReduceValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SparseToDenseValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SparseToDenseValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BucketizeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit BucketizeValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReverseSequenceValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ReverseSequenceValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SqueezeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SqueezeValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class UnsqueezeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit UnsqueezeValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class RangeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit RangeValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class FillValidator : public LayerValidator {
|
||||
public:
|
||||
explicit FillValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BroadcastValidator : public LayerValidator {
|
||||
public:
|
||||
explicit BroadcastValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class RNNBaseValidator : public LayerValidator {
|
||||
public:
|
||||
RNNBaseValidator(const std::string& _type, RNNSequenceLayer::CellType CELL);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
protected:
|
||||
std::vector<std::string> def_acts; // Default values for cell gate activations
|
||||
std::vector<float> def_alpha; // Default activation alpha parameter
|
||||
std::vector<float> def_beta; // Default activation beta parameter
|
||||
size_t G; // gate number
|
||||
size_t NS; // state number
|
||||
};
|
||||
|
||||
template <RNNSequenceLayer::CellType CELL>
|
||||
class RNNCellValidator : public RNNBaseValidator {
|
||||
public:
|
||||
explicit RNNCellValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
extern template class RNNCellValidator<RNNSequenceLayer::LSTM>;
|
||||
extern template class RNNCellValidator<RNNSequenceLayer::GRU>;
|
||||
extern template class RNNCellValidator<RNNSequenceLayer::RNN>;
|
||||
|
||||
template <RNNSequenceLayer::CellType CELL>
|
||||
class RNNSequenceValidator : public RNNBaseValidator {
|
||||
public:
|
||||
explicit RNNSequenceValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
extern template class RNNSequenceValidator<RNNSequenceLayer::LSTM>;
|
||||
extern template class RNNSequenceValidator<RNNSequenceLayer::GRU>;
|
||||
extern template class RNNSequenceValidator<RNNSequenceLayer::RNN>;
|
||||
|
||||
class ArgMaxValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ArgMaxValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class CTCGreedyDecoderValidator : public LayerValidator {
|
||||
public:
|
||||
explicit CTCGreedyDecoderValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class DetectionOutputValidator : public LayerValidator {
|
||||
public:
|
||||
explicit DetectionOutputValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class InterpValidator : public LayerValidator {
|
||||
public:
|
||||
explicit InterpValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PermuteValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PermuteValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PriorBoxValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PriorBoxValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PriorBoxClusteredValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PriorBoxClusteredValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ProposalValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ProposalValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PSROIPoolingValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PSROIPoolingValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class RegionYoloValidator : public LayerValidator {
|
||||
public:
|
||||
explicit RegionYoloValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReorgYoloValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ReorgYoloValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ResampleValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ResampleValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ROIPoolingValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ROIPoolingValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SimplerNMSValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SimplerNMSValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SpatialTransformerValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SpatialTransformerValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class OneHotValidator : public LayerValidator {
|
||||
public:
|
||||
explicit OneHotValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class UpsamplingValidator : public LayerValidator {
|
||||
public:
|
||||
explicit UpsamplingValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ActivationValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ActivationValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ConstValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ConstValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ELUValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ELUValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class InputValidator : public LayerValidator {
|
||||
public:
|
||||
explicit InputValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class MemoryValidator : public LayerValidator {
|
||||
public:
|
||||
explicit MemoryValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class NormalizeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit NormalizeValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class CopyValidator : public LayerValidator {
|
||||
public:
|
||||
explicit CopyValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class PowerFileValidator : public LayerValidator {
|
||||
public:
|
||||
explicit PowerFileValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReLU6Validator : public LayerValidator {
|
||||
public:
|
||||
explicit ReLU6Validator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SigmoidValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SigmoidValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class TanHValidator : public LayerValidator {
|
||||
public:
|
||||
explicit TanHValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class UnpoolingValidator : public LayerValidator {
|
||||
public:
|
||||
explicit UnpoolingValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class QuantizeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit QuantizeValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class BinaryConvolutionValidator : public LayerValidator {
|
||||
public:
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
explicit BinaryConvolutionValidator(const std::string& _type);
|
||||
|
||||
void checkCorrespondence(const CNNLayer* layer, const std::map<std::string, Blob::Ptr>& blobs,
|
||||
const std::vector<SizeVector>& inShapes) const override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class SelectValidator : public LayerValidator {
|
||||
public:
|
||||
explicit SelectValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class MathValidator : public LayerValidator {
|
||||
public:
|
||||
explicit MathValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ReduceValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ReduceValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class GatherTreeValidator : public LayerValidator {
|
||||
public:
|
||||
explicit GatherTreeValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class TopKValidator : public LayerValidator {
|
||||
public:
|
||||
explicit TopKValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class UniqueValidator : public LayerValidator {
|
||||
public:
|
||||
explicit UniqueValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class NMSValidator : public LayerValidator {
|
||||
public:
|
||||
explicit NMSValidator(const std::string& _type);
|
||||
|
||||
void checkParams(const CNNLayer* layer) override;
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ScatterUpdateValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ScatterUpdateValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
class ScatterElementsUpdateValidator : public LayerValidator {
|
||||
public:
|
||||
explicit ScatterElementsUpdateValidator(const std::string& _type);
|
||||
|
||||
void checkShapes(const CNNLayer* layer, const std::vector<SizeVector>& inShapes) const override;
|
||||
};
|
||||
|
||||
} // namespace details
|
||||
} // namespace InferenceEngine
|
Loading…
Reference in New Issue
Block a user