Skip to content

DNN: rename clamp() => normalize_axis()#19428

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:dnn_drop_misbehaved_clamp
Feb 4, 2021
Merged

DNN: rename clamp() => normalize_axis()#19428
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:dnn_drop_misbehaved_clamp

Conversation

@alalek
Copy link
Copy Markdown
Member

@alalek alalek commented Jan 30, 2021

DNN's clamp() implementation is misleading (wrong name is selected).
The real clamp meaning is here: https://en.cppreference.com/w/cpp/algorithm/clamp

relates: opencv/opencv_contrib#1156

force_builders=Custom
buildworker:Custom=linux-4
build_image:Custom=halide:16.04

build_image:Custom Win=openvino-2021.2.0
build_image:Custom Mac=openvino-2020.3.0

test_modules:Custom Win=dnn,python2,python3,java
test_modules:Custom Mac=dnn,python2,python3,java

Copy link
Copy Markdown
Contributor

@sl-sergei sl-sergei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

}

inline int clamp(int ax, int dims)
/// @brief Converts axis from `[-dims; dims)` (similar to Python's slice notation) to `[0; dims]` range.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// @brief Converts axis from `[-dims; dims)` (similar to Python's slice notation) to `[0; dims]` range.
/// @brief Converts axis from `[-dims; dims)` (similar to Python's slice notation) to `[0; dims)` range.

@opencv-pushbot opencv-pushbot merged commit 4f08bb5 into opencv:3.4 Feb 4, 2021
@alalek alalek mentioned this pull request Feb 5, 2021
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants