Fixed several issues found by static analysis#19620
Fixed several issues found by static analysis#19620opencv-pushbot merged 1 commit intoopencv:masterfrom
Conversation
| : base(base_), scale(scale_), shift(shift_) | ||
| { | ||
| CV_Check(base, base == -1.f || base > 0.f, "Unsupported 'base' value"); | ||
| finalize(); // init normScale and normShift |
There was a problem hiding this comment.
It make sense to move finalize "body" here instead (and keep finalize empty).
There was a problem hiding this comment.
I'm not sure, for some reason functors were designed to implement layer's finalize method and all data members of this class are public, so they can be changed externally and then finalized to calculate norm parameters.
cc @SamFC10 , @l-bat
There was a problem hiding this comment.
Only ExpLayer::create() (below) knows about this class.
Base class assumes "updates" through tryFuse() callback, but it is not implemented here. Perhaps even finalize() with empty body is not needed.
There was a problem hiding this comment.
Isn't it meant to be called here?
opencv/modules/dnn/src/layers/elementwise_layers.cpp
Lines 129 to 132 in 7328600
There was a problem hiding this comment.
There is already empty implementation in the base class:
There was a problem hiding this comment.
My initial thought was to initialize the norm fields here and not have finalize() at all like @alalek suggests. I added it to finalize() instead as the PowerLayer above has a similar finalize() method and thought initializing norm fields in finalize() instead of the constructor "shouldn't" really affect the layer's implementation as finalize() is called before forward() anyway. Now I think its better to shift finalize() body here and remove it.
|
jenkins cn please retry a build |
ead189e to
dd59761
Compare
No description provided.