mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -132,6 +132,16 @@ public:
|
||||
if (hasWeights && hasBias)
|
||||
CV_CheckEQ(weights.total(), bias.total(), "Incompatible weights/bias blobs");
|
||||
|
||||
if (weights.total() == 1)
|
||||
{
|
||||
// The total() of bias should be same as weights.
|
||||
if (hasBias)
|
||||
inpBlob.convertTo(outBlob, CV_32F, weights.at<float>(0), bias.at<float>(0));
|
||||
else
|
||||
inpBlob.convertTo(outBlob, CV_32F, weights.at<float>(0));
|
||||
return;
|
||||
}
|
||||
|
||||
int endAxis;
|
||||
for (endAxis = axis + 1; endAxis <= inpBlob.dims; ++endAxis)
|
||||
{
|
||||
|
||||
@@ -2026,6 +2026,8 @@ void ONNXImporter::parseMatMul(LayerParams& layerParams, const opencv_onnx::Node
|
||||
|
||||
void findBroadAxis(const MatShape& broadShape, const MatShape& outShape, size_t& axis, int& broadAxis)
|
||||
{
|
||||
// Currently, this function can only complete 1-dimensional expansion of broadShape.
|
||||
// If there are two dimensions in broadShape that need to be expended, it will fail.
|
||||
const size_t diff = outShape.size() - broadShape.size();
|
||||
|
||||
// find the first non-one element of the broadcasting shape
|
||||
|
||||
Reference in New Issue
Block a user