[LPT] Security fixes (#8436)

This commit is contained in:
Vladislav Golubev 2021-11-12 01:10:02 +03:00 committed by GitHub
parent 8f55d72c93
commit 0c3cee5e3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 14 deletions

View File

@ -16,8 +16,8 @@ public:
NGRAPH_RTTI_DECLARATION;
ConvolutionTransformation(const Params& params = Params());
bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override;
bool isQuantized(const std::shared_ptr<const Node>& layer) const noexcept override;
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer) noexcept;
bool isQuantized(const std::shared_ptr<const Node>& layer) const override;
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer);
};
} // namespace low_precision

View File

@ -16,8 +16,8 @@ public:
ConvolutionBackpropDataTransformation(const Params& params = Params());
bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override;
bool canBeTransformed(const TransformationContext& context, std::shared_ptr<Node> op) const override;
bool isQuantized(const std::shared_ptr<const Node>& layer) const noexcept override;
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer) noexcept;
bool isQuantized(const std::shared_ptr<const Node>& layer) const override;
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer);
};
} // namespace low_precision

View File

@ -16,8 +16,8 @@ public:
NGRAPH_RTTI_DECLARATION;
GroupConvolutionTransformation(const Params& params = Params());
bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override;
bool isQuantized(const std::shared_ptr<const Node>& layer) const noexcept override;
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer) noexcept;
bool isQuantized(const std::shared_ptr<const Node>& layer) const override;
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer);
};
} // namespace low_precision

View File

@ -253,7 +253,7 @@ public:
// return true if operation can be quantized and false otherwise
// for example: if convolution operation weights are not quantized, then isQuantize returns false and true otherwise
// note: dequantization operations on activations are absent during method execution
virtual bool isQuantized(const std::shared_ptr<const Node>& layer) const noexcept;
virtual bool isQuantized(const std::shared_ptr<const Node>& layer) const;
// return true if operation can be preserved for precision
// note: dequantization operations on activations are absent during method execution

View File

@ -43,11 +43,11 @@ ConvolutionTransformation::ConvolutionTransformation(const Params& params) : Wei
this->register_matcher(m, callback);
}
bool ConvolutionTransformation::isQuantized(const std::shared_ptr<const Node>& layer) const noexcept {
bool ConvolutionTransformation::isQuantized(const std::shared_ptr<const Node>& layer) const {
return ConvolutionTransformation::isQuantizedStatic(layer);
}
bool ConvolutionTransformation::isQuantizedStatic(const std::shared_ptr<const Node>& layer) noexcept {
bool ConvolutionTransformation::isQuantizedStatic(const std::shared_ptr<const Node>& layer) {
return WeightableLayerTransformation::isQuantizedStatic(layer, false);
}

View File

@ -53,11 +53,11 @@ ConvolutionBackpropDataTransformation::ConvolutionBackpropDataTransformation(con
this->register_matcher(m, callback);
}
bool ConvolutionBackpropDataTransformation::isQuantized(const std::shared_ptr<const Node>& layer) const noexcept {
bool ConvolutionBackpropDataTransformation::isQuantized(const std::shared_ptr<const Node>& layer) const {
return ConvolutionBackpropDataTransformation::isQuantizedStatic(layer);
}
bool ConvolutionBackpropDataTransformation::isQuantizedStatic(const std::shared_ptr<const Node>& layer) noexcept {
bool ConvolutionBackpropDataTransformation::isQuantizedStatic(const std::shared_ptr<const Node>& layer) {
return WeightableLayerTransformation::isQuantizedStatic(layer, false);
}

View File

@ -32,7 +32,7 @@ GroupConvolutionTransformation::GroupConvolutionTransformation(const Params& par
this->register_matcher(m, callback);
}
bool GroupConvolutionTransformation::isQuantized(const std::shared_ptr<const Node>& layer) const noexcept {
bool GroupConvolutionTransformation::isQuantized(const std::shared_ptr<const Node>& layer) const {
return GroupConvolutionTransformation::isQuantizedStatic(layer);
}
@ -47,7 +47,7 @@ bool GroupConvolutionTransformation::transform(TransformationContext &context, n
return true;
}
bool GroupConvolutionTransformation::isQuantizedStatic(const std::shared_ptr<const Node>& layer) noexcept {
bool GroupConvolutionTransformation::isQuantizedStatic(const std::shared_ptr<const Node>& layer) {
return WeightableLayerTransformation::isQuantizedStatic(layer, true);
}

View File

@ -320,7 +320,7 @@ bool LayerTransformation::isAsymmetricQuantization(const std::shared_ptr<const N
return dequantization.subtract != nullptr;
}
bool LayerTransformation::isQuantized(const std::shared_ptr<const Node>& layer) const noexcept {
bool LayerTransformation::isQuantized(const std::shared_ptr<const Node>& layer) const {
return true;
}