[LPT] Security fixes (#8436)
This commit is contained in:
parent
8f55d72c93
commit
0c3cee5e3b
@ -16,8 +16,8 @@ public:
|
|||||||
NGRAPH_RTTI_DECLARATION;
|
NGRAPH_RTTI_DECLARATION;
|
||||||
ConvolutionTransformation(const Params& params = Params());
|
ConvolutionTransformation(const Params& params = Params());
|
||||||
bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override;
|
bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override;
|
||||||
bool isQuantized(const std::shared_ptr<const Node>& layer) const noexcept override;
|
bool isQuantized(const std::shared_ptr<const Node>& layer) const override;
|
||||||
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer) noexcept;
|
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace low_precision
|
} // namespace low_precision
|
||||||
|
@ -16,8 +16,8 @@ public:
|
|||||||
ConvolutionBackpropDataTransformation(const Params& params = Params());
|
ConvolutionBackpropDataTransformation(const Params& params = Params());
|
||||||
bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override;
|
bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override;
|
||||||
bool canBeTransformed(const TransformationContext& context, std::shared_ptr<Node> op) const 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;
|
bool isQuantized(const std::shared_ptr<const Node>& layer) const override;
|
||||||
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer) noexcept;
|
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace low_precision
|
} // namespace low_precision
|
||||||
|
@ -16,8 +16,8 @@ public:
|
|||||||
NGRAPH_RTTI_DECLARATION;
|
NGRAPH_RTTI_DECLARATION;
|
||||||
GroupConvolutionTransformation(const Params& params = Params());
|
GroupConvolutionTransformation(const Params& params = Params());
|
||||||
bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override;
|
bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override;
|
||||||
bool isQuantized(const std::shared_ptr<const Node>& layer) const noexcept override;
|
bool isQuantized(const std::shared_ptr<const Node>& layer) const override;
|
||||||
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer) noexcept;
|
static bool isQuantizedStatic(const std::shared_ptr<const Node>& layer);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace low_precision
|
} // namespace low_precision
|
||||||
|
@ -253,7 +253,7 @@ public:
|
|||||||
// return true if operation can be quantized and false otherwise
|
// 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
|
// 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
|
// 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
|
// return true if operation can be preserved for precision
|
||||||
// note: dequantization operations on activations are absent during method execution
|
// note: dequantization operations on activations are absent during method execution
|
||||||
|
@ -43,11 +43,11 @@ ConvolutionTransformation::ConvolutionTransformation(const Params& params) : Wei
|
|||||||
this->register_matcher(m, callback);
|
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);
|
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);
|
return WeightableLayerTransformation::isQuantizedStatic(layer, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,11 +53,11 @@ ConvolutionBackpropDataTransformation::ConvolutionBackpropDataTransformation(con
|
|||||||
this->register_matcher(m, callback);
|
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);
|
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);
|
return WeightableLayerTransformation::isQuantizedStatic(layer, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ GroupConvolutionTransformation::GroupConvolutionTransformation(const Params& par
|
|||||||
this->register_matcher(m, callback);
|
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);
|
return GroupConvolutionTransformation::isQuantizedStatic(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ bool GroupConvolutionTransformation::transform(TransformationContext &context, n
|
|||||||
return true;
|
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);
|
return WeightableLayerTransformation::isQuantizedStatic(layer, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ bool LayerTransformation::isAsymmetricQuantization(const std::shared_ptr<const N
|
|||||||
return dequantization.subtract != nullptr;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user