History

dnn_backend_native_layer_mathunary: add round support

Mingyu Yin committed 6 years ago

Commit 4ed6bca1 parent ed39d285 files · +11 −2Browse files

Showing the changes to libavfilter (2 of 5 files). Show all

Unified · Split

2 files
  1. libavfilter/dnn/dnn_backend_native_layer_mathunary.c +4 −0
  2. libavfilter/dnn/dnn_backend_native_layer_mathunary.h +1 −0
libavfilter/dnn/dnn_backend_native_layer_mathunary.c+4−0
@@ -138,6 +138,10 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_oper · 137 unmodified lines
138 for (int i = 0; i < dims_count; ++i)138 for (int i = 0; i < dims_count; ++i)
139 dst[i] = floor(src[i]);139 dst[i] = floor(src[i]);
140 return 0;140 return 0;
141 case DMUO_ROUND:
142 for (int i = 0; i < dims_count; ++i)
143 dst[i] = round(src[i]);
144 return 0;
141 default:145 default:
142 return -1;146 return -1;
143 }147 }
libavfilter/dnn/dnn_backend_native_layer_mathunary.h+1−0
@@ -45,6 +45,7 @@ typedef enum { · 44 unmodified lines
45 DMUO_ATANH = 12,45 DMUO_ATANH = 12,
46 DMUO_CEIL = 13,46 DMUO_CEIL = 13,
47 DMUO_FLOOR = 14,47 DMUO_FLOOR = 14,
48 DMUO_ROUND = 15,
48 DMUO_COUNT49 DMUO_COUNT
49} DNNMathUnaryOperation;50} DNNMathUnaryOperation;
50 51

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t