/home/liu/actions-runner/_work/ccv/ccv/lib/nnc/cmd/ccv_nnc_cmd_easy.h
Line | Count | Source (jump to first uncovered line) |
1 | | /** |
2 | | * @addtogroup available_commands Available Commands |
3 | | * @{ |
4 | | */ |
5 | | // CCV_NNC_ADAM_FORWARD |
6 | 1.02k | #define CMD_ADAM_FORWARD(_step, _rate, _beta1, _beta2, _decay, _epsilon, _amsgrad) ccv_nnc_cmd(CCV_NNC_ADAM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.adam={.step=_step,.rate=_rate,.scale=1,.beta1=_beta1,.beta2=_beta2,.decay=_decay,.epsilon=_epsilon,.amsgrad=_amsgrad}}), 0) |
7 | | // CCV_NNC_ADAMW_FORWARD |
8 | 1.02k | #define CMD_ADAMW_FORWARD(_step, _rate, _beta1, _beta2, _decay, _epsilon, _amsgrad) ccv_nnc_cmd(CCV_NNC_ADAMW_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.adam={.step=_step,.rate=_rate,.scale=1,.beta1=_beta1,.beta2=_beta2,.decay=_decay,.epsilon=_epsilon,.amsgrad=_amsgrad}}), 0) |
9 | | // CCV_NNC_GEMM_FORWARD |
10 | 2.16k | #define CMD_GEMM_FORWARD(...) ccv_nnc_cmd(CCV_NNC_GEMM_FORWARD, 0, CMD_GEMM(__VA_ARGS__), 0) |
11 | | // CCV_NNC_GEMM_BACKWARD |
12 | 51 | #define CMD_GEMM_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_GEMM_BACKWARD, 0, CMD_GEMM(__VA_ARGS__), 0) |
13 | | // CCV_NNC_ADD_FORWARD |
14 | 2.26k | #define CMD_ADD_FORWARD(_p, _q) ccv_nnc_cmd(CCV_NNC_ADD_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_p, _q}}}, 0) |
15 | | // CCV_NNC_ADD_BACKWARD |
16 | 4 | #define CMD_ADD_BACKWARD(_p, _q) ccv_nnc_cmd(CCV_NNC_ADD_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_p, _q}}}, 0) |
17 | | // CCV_NNC_MUL_FORWARD |
18 | 4.05k | #define CMD_MUL_FORWARD(_p) ccv_nnc_cmd(CCV_NNC_MUL_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_p,}}}, 0) |
19 | | // CCV_NNC_MUL_BACKWARD |
20 | 8 | #define CMD_MUL_BACKWARD(_p) ccv_nnc_cmd(CCV_NNC_MUL_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_p,}}}, 0) |
21 | | // CCV_NNC_SCALAR_MUL_FORWARD |
22 | 73 | #define CMD_SCALAR_MUL_FORWARD(_a) ccv_nnc_cmd(CCV_NNC_SCALAR_MUL_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_a,}}}, 0) |
23 | | // CCV_NNC_SCALAR_MUL_BACKWARD |
24 | 0 | #define CMD_SCALAR_MUL_BACKWARD(_a) ccv_nnc_cmd(CCV_NNC_SCALAR_MUL_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_a,}}}, 0) |
25 | | // CCV_NNC_CMUL_FORWARD |
26 | 8 | #define CMD_CMUL_FORWARD() ccv_nnc_cmd(CCV_NNC_CMUL_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}}}, 0) |
27 | | // CCV_NNC_CMUL_BACKWARD |
28 | 4 | #define CMD_CMUL_BACKWARD() ccv_nnc_cmd(CCV_NNC_CMUL_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}}}, 0) |
29 | | // CCV_NNC_COMM_ALLREDUCE_FORWARD |
30 | 142 | #define CMD_COMM_ALLREDUCE_FORWARD() ccv_nnc_cmd(CCV_NNC_COMM_ALLREDUCE_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
31 | | // CCV_NNC_COMM_ALLREDUCE_BACKWARD |
32 | | #define CMD_COMM_ALLREDUCE_BACKWARD() ccv_nnc_cmd(CCV_NNC_COMM_ALLREDUCE_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
33 | | // CCV_NNC_COMM_BROADCAST_FORWARD |
34 | 14 | #define CMD_COMM_BROADCAST_FORWARD() ccv_nnc_cmd(CCV_NNC_COMM_BROADCAST_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
35 | | // CCV_NNC_COMM_ALLREDUCE_BACKWARD |
36 | | #define CMD_COMM_BROADCAST_BACKWARD() ccv_nnc_cmd(CCV_NNC_COMM_BROADCAST_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
37 | | // CCV_NNC_COMM_REDUCE_FORWARD |
38 | 10 | #define CMD_COMM_REDUCE_FORWARD() ccv_nnc_cmd(CCV_NNC_COMM_REDUCE_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
39 | | // CCV_NNC_COMM_REDUCE_BACKWARD |
40 | | #define CMD_COMM_REDUCE_BACKWARD() ccv_nnc_cmd(CCV_NNC_COMM_REDUCE_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
41 | | // CCV_NNC_MIN_FORWARD |
42 | 3 | #define CMD_MIN_FORWARD() ccv_nnc_cmd(CCV_NNC_MIN_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}}}, 0) |
43 | | // CCV_NNC_MIN_BACKWARD |
44 | 6 | #define CMD_MIN_BACKWARD() ccv_nnc_cmd(CCV_NNC_MIN_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}}}, 0) |
45 | | // CCV_NNC_MAX_FORWARD |
46 | 5 | #define CMD_MAX_FORWARD() ccv_nnc_cmd(CCV_NNC_MAX_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}}}, 0) |
47 | | // CCV_NNC_MAX_BACKWARD |
48 | 6 | #define CMD_MAX_BACKWARD() ccv_nnc_cmd(CCV_NNC_MAX_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}}}, 0) |
49 | | // CCV_NNC_COMPRESSION_LSSC_FORWARD |
50 | 20 | #define CMD_COMPRESSION_LSSC_FORWARD() ccv_nnc_cmd(CCV_NNC_COMPRESSION_LSSC_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
51 | | // CCV_NNC_COMPRESSION_LSSC_BACKWARD |
52 | 10 | #define CMD_COMPRESSION_LSSC_BACKWARD() ccv_nnc_cmd(CCV_NNC_COMPRESSION_LSSC_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
53 | | // CCV_NNC_CONVOLUTION_FORWARD |
54 | 232 | #define CMD_CONVOLUTION_FORWARD(_groups, _count, ...) ccv_nnc_cmd(CCV_NNC_CONVOLUTION_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={__VA_ARGS__}},.convolution={.count=_count,.groups=_groups}}), 0) |
55 | | // CCV_NNC_CONVOLUTION_BACKWARD |
56 | 9 | #define CMD_CONVOLUTION_BACKWARD(_groups, _count, ...) ccv_nnc_cmd(CCV_NNC_CONVOLUTION_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={__VA_ARGS__}},.convolution={.count=_count,.groups=_groups}}), 0) |
57 | | // CCV_NNC_CONVOLUTION_TRANSPOSE_FORWARD |
58 | 9 | #define CMD_CONVOLUTION_TRANSPOSE_FORWARD(_groups, _count, _output_padding, ...) ccv_nnc_cmd(CCV_NNC_CONVOLUTION_TRANSPOSE_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={__VA_ARGS__}},.convolution_transpose={.count=_count,.groups=_groups,.output_padding=_output_padding}}), 0) |
59 | | // CCV_NNC_CONVOLUTION_TRANSPOSE_BACKWARD |
60 | | #define CMD_CONVOLUTION_TRANSPOSE_BACKWARD(_groups, _count, _output_padding, ...) ccv_nnc_cmd(CCV_NNC_CONVOLUTION_TRANSPOSE_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={__VA_ARGS__}},.convolution_transpose={.count=_count,.groups=_groups,.output_padding=_output_padding}}), 0) |
61 | | // CCV_NNC_DROPOUT_FORWARD |
62 | | #define CMD_DROPOUT_FORWARD_X_F(...) ("This should not be used, you should have either 1 parameter or 2 parameters for CMD_DROPOUT_FORWARD") |
63 | 12 | #define CMD_DROPOUT_FORWARD_X_1(_p) ccv_nnc_cmd(CCV_NNC_DROPOUT_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.dropout={.p=_p,.entirety=0}}), 0) |
64 | 28 | #define CMD_DROPOUT_FORWARD_X_2(_p, _entirety) ccv_nnc_cmd(CCV_NNC_DROPOUT_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.dropout={.p=_p,.entirety=_entirety}}), 0) |
65 | 40 | #define CMD_DROPOUT_FORWARD_X_SEL(_0, _1, _2, _FX, ...) _FX |
66 | 40 | #define CMD_DROPOUT_FORWARD(...) CMD_DROPOUT_FORWARD_X_SEL(CMD_DROPOUT_FORWARD_X_F, ##__VA_ARGS__, CMD_DROPOUT_FORWARD_X_228 , CMD_DROPOUT_FORWARD_X_112 , CMD_DROPOUT_FORWARD_X_F)(__VA_ARGS__) |
67 | | // CCV_NNC_DROPOUT_BACKWARD |
68 | | #define CMD_DROPOUT_BACKWARD_X_F(...) ("This should not be used, you should have either 1 parameter or 2 parameters for CMD_DROPOUT_FORWARD") |
69 | 1 | #define CMD_DROPOUT_BACKWARD_X_1(_p) ccv_nnc_cmd(CCV_NNC_DROPOUT_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.dropout={.p=_p,.entirety=0}}), 0) |
70 | 2 | #define CMD_DROPOUT_BACKWARD_X_2(_p, _entirety) ccv_nnc_cmd(CCV_NNC_DROPOUT_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.dropout={.p=_p,.entirety=_entirety}}), 0) |
71 | 3 | #define CMD_DROPOUT_BACKWARD_X_SEL(_0, _1, _2, _FX, ...) _FX |
72 | 3 | #define CMD_DROPOUT_BACKWARD(...) CMD_DROPOUT_BACKWARD_X_SEL(CMD_DROPOUT_BACKWARD_X_F, ##__VA_ARGS__, CMD_DROPOUT_BACKWARD_X_22 , CMD_DROPOUT_BACKWARD_X_11 , CMD_DROPOUT_BACKWARD_X_F)(__VA_ARGS__) |
73 | | // CCV_NNC_EWSUM_FORWARD |
74 | 2.14k | #define CMD_EWSUM_FORWARD() ccv_nnc_cmd(CCV_NNC_EWSUM_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
75 | | // CCV_NNC_EWSUM_BACKWARD |
76 | | #define CMD_EWSUM_BACKWARD() ccv_nnc_cmd(CCV_NNC_EWSUM_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
77 | | // CCV_NNC_EWPROD_FORWARD |
78 | 2.32k | #define CMD_EWPROD_FORWARD() ccv_nnc_cmd(CCV_NNC_EWPROD_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
79 | | // CCV_NNC_EWPROD_BACKWARD |
80 | 1 | #define CMD_EWPROD_BACKWARD() ccv_nnc_cmd(CCV_NNC_EWPROD_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
81 | | // CCV_NNC_EWDIV_FORWARD |
82 | 34 | #define CMD_EWDIV_FORWARD() ccv_nnc_cmd(CCV_NNC_EWDIV_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
83 | | // CCV_NNC_EWDIV_BACKWARD |
84 | 5 | #define CMD_EWDIV_BACKWARD() ccv_nnc_cmd(CCV_NNC_EWDIV_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
85 | | // CCV_NNC_EWEXP_FORWARD |
86 | 23 | #define CMD_EWEXP_FORWARD() ccv_nnc_cmd(CCV_NNC_EWEXP_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
87 | | // CCV_NNC_EWEXP_BACKWARD |
88 | 2 | #define CMD_EWEXP_BACKWARD() ccv_nnc_cmd(CCV_NNC_EWEXP_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
89 | | // CCV_NNC_EWLOG_FORWARD |
90 | 255 | #define CMD_EWLOG_FORWARD() ccv_nnc_cmd(CCV_NNC_EWLOG_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
91 | | // CCV_NNC_EWLOG_BACKWARD |
92 | 2 | #define CMD_EWLOG_BACKWARD() ccv_nnc_cmd(CCV_NNC_EWLOG_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
93 | | // CCV_NNC_EWSQRT_FORWARD |
94 | 7 | #define CMD_EWSQRT_FORWARD() ccv_nnc_cmd(CCV_NNC_EWSQRT_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
95 | | // CCV_NNC_EWSQRT_BACKWARD |
96 | 2 | #define CMD_EWSQRT_BACKWARD() ccv_nnc_cmd(CCV_NNC_EWSQRT_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
97 | | // CCV_NNC_CLAMP_FORWARD |
98 | 14 | #define CMD_CLAMP_FORWARD(_min, _max) ccv_nnc_cmd(CCV_NNC_CLAMP_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.clamp={.min=_min,.max=_max}}, 0) |
99 | | // CCV_NNC_CLAMP_BACKWARD |
100 | 6 | #define CMD_CLAMP_BACKWARD(_min, _max) ccv_nnc_cmd(CCV_NNC_CLAMP_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.clamp={.min=_min,.max=_max}}, 0) |
101 | | // CCV_NNC_GELU_FORWARD |
102 | 17 | #define CMD_GELU_FORWARD(_tanh) ccv_nnc_cmd(CCV_NNC_GELU_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.gelu={.tanh=_tanh}}, 0) |
103 | | // CCV_NNC_GELU_BACKWARD |
104 | 4 | #define CMD_GELU_BACKWARD(_tanh) ccv_nnc_cmd(CCV_NNC_GELU_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.gelu={.tanh=_tanh}}, 0) |
105 | | // CCV_NNC_HISTOGRAM_FORWARD |
106 | 2 | #define CMD_HISTOGRAM_EVEN(_bins, _min, _max) ccv_nnc_cmd(CCV_NNC_HISTOGRAM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.histogram={.type=CCV_NNC_HISTOGRAM_EVEN,.bins=_bins,.min=_min,.max=_max}}), 0) |
107 | | // CCV_NNC_HISTOGRAM_FORWARD |
108 | 2 | #define CMD_HISTOGRAM_LOG_X_0() ccv_nnc_cmd(CCV_NNC_HISTOGRAM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.histogram={.type=CCV_NNC_HISTOGRAM_LOGARITHMIC,.min=1e-12,.max=1e20,.rate=1.1}}), 0) |
109 | | #define CMD_HISTOGRAM_LOG_X_F(...) ("This should not be used, you should have either 0 parameter or 3 parameters for CMD_HISTOGRAM_LOG") |
110 | | #define CMD_HISTOGRAM_LOG_X_2(_min, _max, _rate) ccv_nnc_cmd(CCV_NNC_HISTOGRAM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.histogram={.type=CCV_NNC_HISTOGRAM_LOGARITHMIC,.min=_min,.max=_max,.rate=_rate}}), 0) |
111 | 2 | #define CMD_HISTOGRAM_LOG_X_SEL(_0, _1, _2, _3, _FX, ...) _FX |
112 | 2 | #define CMD_HISTOGRAM_LOG(...) CMD_HISTOGRAM_LOG_X_SEL(CMD_HISTOGRAM_LOG_X_F, ##__VA_ARGS__, CMD_HISTOGRAM_LOG_X_3, CMD_HISTOGRAM_LOG_X_F, CMD_HISTOGRAM_LOG_X_F, CMD_HISTOGRAM_LOG_X_0)(__VA_ARGS__) |
113 | | // CCV_NNC_HISTOGRAM_FORWARD |
114 | 4 | #define CMD_HISTOGRAM_BINS() ccv_nnc_cmd(CCV_NNC_HISTOGRAM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.histogram={.type=CCV_NNC_HISTOGRAM_BINS}}), 0) |
115 | | // CCV_NNC_INDEX_SELECT_FORWARD |
116 | 24 | #define CMD_INDEX_SELECT_FORWARD() ccv_nnc_cmd(CCV_NNC_INDEX_SELECT_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
117 | | // CCV_NNC_INDEX_SELECT_BACKWARD |
118 | 8 | #define CMD_INDEX_SELECT_BACKWARD() ccv_nnc_cmd(CCV_NNC_INDEX_SELECT_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
119 | | // CCV_NNC_REDUCE_ISNAN_FORWARD |
120 | 5 | #define CMD_REDUCE_ISNAN_FORWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_ISNAN_FORWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
121 | | // CCV_NNC_REDUCE_ISNAN_BACKWARD |
122 | | #define CMD_REDUCE_ISNAN_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_ISNAN_BACKWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
123 | | // CCV_NNC_LAMB_FORWARD |
124 | 14 | #define CMD_LAMB_FORWARD(_step, _rate, _beta1, _beta2, _decay, _epsilon) ccv_nnc_cmd(CCV_NNC_LAMB_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.lamb={.step=_step,.rate=_rate,.scale=1,.beta1=_beta1,.beta2=_beta2,.decay=_decay,.epsilon=_epsilon}}), 0) |
125 | | // CCV_NNC_LEAKY_RELU_FORWARD |
126 | 8 | #define CMD_LEAKY_RELU_FORWARD(_negative_slope) ccv_nnc_cmd(CCV_NNC_LEAKY_RELU_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.leaky_relu={.negative_slope=_negative_slope}}, 0) |
127 | | // CCV_NNC_LEAKY_RELU_BACKWARD |
128 | 2 | #define CMD_LEAKY_RELU_BACKWARD(_negative_slope) ccv_nnc_cmd(CCV_NNC_LEAKY_RELU_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.leaky_relu={.negative_slope=_negative_slope}}, 0) |
129 | | // CCV_NNC_BINARY_CROSSENTROPY_FORWARD |
130 | 13 | #define CMD_BINARY_CROSSENTROPY_FORWARD_X_0() ccv_nnc_cmd(CCV_NNC_BINARY_CROSSENTROPY_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.binary_crossentropy={.pos_weight=1}}), 0) |
131 | | #define CMD_BINARY_CROSSENTROPY_FORWARD_X_F(...) ("This should not be used, you should have either 0 parameter or 2 parameters for CMD_BINARY_CROSSENTROPY_FORWARD") |
132 | 13 | #define CMD_BINARY_CROSSENTROPY_FORWARD_X_1(_pos_weight) ccv_nnc_cmd(CCV_NNC_BINARY_CROSSENTROPY_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.binary_crossentropy={.pos_weight=_pos_weight}}), 0) |
133 | 26 | #define CMD_BINARY_CROSSENTROPY_FORWARD_X_SEL(_0, _1, _FX, ...) _FX |
134 | 26 | #define CMD_BINARY_CROSSENTROPY_FORWARD(...) CMD_BINARY_CROSSENTROPY_FORWARD_X_SEL(CMD_BINARY_CROSSENTROPY_FORWARD_X_F, ##__VA_ARGS__, CMD_BINARY_CROSSENTROPY_FORWARD_X_113 , CMD_BINARY_CROSSENTROPY_FORWARD_X_013 )(__VA_ARGS__) |
135 | | // CCV_NNC_BINARY_CROSSENTROPY_BACKWARD |
136 | 8 | #define CMD_BINARY_CROSSENTROPY_BACKWARD_X_0() ccv_nnc_cmd(CCV_NNC_BINARY_CROSSENTROPY_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.binary_crossentropy={.pos_weight=1}}), 0) |
137 | | #define CMD_BINARY_CROSSENTROPY_BACKWARD_X_F(...) ("This should not be used, you should have either 0 parameter or 2 parameters for CMD_BINARY_CROSSENTROPY_BACKWARD") |
138 | 8 | #define CMD_BINARY_CROSSENTROPY_BACKWARD_X_1(_pos_weight) ccv_nnc_cmd(CCV_NNC_BINARY_CROSSENTROPY_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.binary_crossentropy={.pos_weight=_pos_weight}}), 0) |
139 | 16 | #define CMD_BINARY_CROSSENTROPY_BACKWARD_X_SEL(_0, _1, _FX, ...) _FX |
140 | 16 | #define CMD_BINARY_CROSSENTROPY_BACKWARD(...) CMD_BINARY_CROSSENTROPY_BACKWARD_X_SEL(CMD_BINARY_CROSSENTROPY_BACKWARD_X_F, ##__VA_ARGS__, CMD_BINARY_CROSSENTROPY_BACKWARD_X_18 , CMD_BINARY_CROSSENTROPY_BACKWARD_X_08 )(__VA_ARGS__) |
141 | | // CCV_NNC_CATEGORICAL_CROSSENTROPY_FORWARD |
142 | 15 | #define CMD_CATEGORICAL_CROSSENTROPY_FORWARD_X_0() ccv_nnc_cmd(CCV_NNC_CATEGORICAL_CROSSENTROPY_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.label_smoothing={.trim0=0,.trim1=1}}), 0) |
143 | | #define CMD_CATEGORICAL_CROSSENTROPY_FORWARD_X_F(...) ("This should not be used, you should have either 0 parameter or 2 parameters for CMD_CATEGORICAL_CROSSENTROPY_FORWARD") |
144 | 10 | #define CMD_CATEGORICAL_CROSSENTROPY_FORWARD_X_2(_trim0, _trim1) ccv_nnc_cmd(CCV_NNC_CATEGORICAL_CROSSENTROPY_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.label_smoothing={.trim0=_trim0,.trim1=_trim1}}), 0) |
145 | 25 | #define CMD_CATEGORICAL_CROSSENTROPY_FORWARD_X_SEL(_0, _1, _2, _FX, ...) _FX |
146 | 25 | #define CMD_CATEGORICAL_CROSSENTROPY_FORWARD(...) CMD_CATEGORICAL_CROSSENTROPY_FORWARD_X_SEL(CMD_CATEGORICAL_CROSSENTROPY_FORWARD_X_F, ##__VA_ARGS__, CMD_CATEGORICAL_CROSSENTROPY_FORWARD_X_210 , CMD_CATEGORICAL_CROSSENTROPY_FORWARD_X_F, CMD_CATEGORICAL_CROSSENTROPY_FORWARD_X_015 )(__VA_ARGS__) |
147 | | // CCV_NNC_CATEGORICAL_CROSSENTROPY_BACKWARD |
148 | 4 | #define CMD_CATEGORICAL_CROSSENTROPY_BACKWARD_X_0() ccv_nnc_cmd(CCV_NNC_CATEGORICAL_CROSSENTROPY_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.label_smoothing={.trim0=0,.trim1=1}}), 0) |
149 | | #define CMD_CATEGORICAL_CROSSENTROPY_BACKWARD_X_F(...) ("This should not be used, you should have either 0 parameter or 2 parameters for CMD_CATEGORICAL_CROSSENTROPY_BACKWARD") |
150 | 4 | #define CMD_CATEGORICAL_CROSSENTROPY_BACKWARD_X_2(_trim0, _trim1) ccv_nnc_cmd(CCV_NNC_CATEGORICAL_CROSSENTROPY_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.label_smoothing={.trim0=_trim0,.trim1=_trim1}}), 0) |
151 | 8 | #define CMD_CATEGORICAL_CROSSENTROPY_BACKWARD_X_SEL(_0, _1, _2, _FX, ...) _FX |
152 | 8 | #define CMD_CATEGORICAL_CROSSENTROPY_BACKWARD(...) CMD_CATEGORICAL_CROSSENTROPY_BACKWARD_X_SEL(CMD_CATEGORICAL_CROSSENTROPY_BACKWARD_X_F, ##__VA_ARGS__, CMD_CATEGORICAL_CROSSENTROPY_BACKWARD_X_24 , CMD_CATEGORICAL_CROSSENTROPY_BACKWARD_X_F, CMD_CATEGORICAL_CROSSENTROPY_BACKWARD_X_04 )(__VA_ARGS__) |
153 | | // CCV_NNC_MSE_FORWARD |
154 | 15 | #define CMD_MSE_FORWARD(_reduce_op) ccv_nnc_cmd(CCV_NNC_MSE_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.mse={.reduce_op=_reduce_op}}), 0) |
155 | | // CCV_NNC_MSE_BACKWARD |
156 | 6 | #define CMD_MSE_BACKWARD(_reduce_op) ccv_nnc_cmd(CCV_NNC_MSE_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.mse={.reduce_op=_reduce_op}}), 0) |
157 | | // CCV_NNC_SMOOTH_L1_FORWARD |
158 | 7 | #define CMD_SMOOTH_L1_FORWARD(_b) ccv_nnc_cmd(CCV_NNC_SMOOTH_L1_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.smooth_l1={.beta=_b}}), 0) |
159 | | // CCV_NNC_SMOOTH_L1_BACKWARD |
160 | 4 | #define CMD_SMOOTH_L1_BACKWARD(_b) ccv_nnc_cmd(CCV_NNC_SMOOTH_L1_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.smooth_l1={.beta=_b}}), 0) |
161 | | // CCV_NNC_NMS_FORWARD |
162 | 6 | #define CMD_NMS_FORWARD(_iou_threshold) ccv_nnc_cmd(CCV_NNC_NMS_FORWARD, 0, ((ccv_nnc_cmd_param_t){.nms={.iou_threshold=_iou_threshold}}), 0) |
163 | | // CCV_NNC_NMS_BACKWARD |
164 | 2 | #define CMD_NMS_BACKWARD(_iou_threshold) ccv_nnc_cmd(CCV_NNC_NMS_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.nms={.iou_threshold=_iou_threshold}}), 0) |
165 | | // CCV_NNC_BATCH_NORM_FORWARD |
166 | 16 | #define CMD_BATCH_NORM_FORWARD(_epsilon, _is_test, _momentum, ...) ccv_nnc_cmd(CCV_NNC_BATCH_NORM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.bnorm={.epsilon=_epsilon,.is_test=_is_test,.momentum=_momentum,.count=LIST_COUNT(__VA_ARGS__),.axis={__VA_ARGS__}}}), 0) |
167 | | // CCV_NNC_BATCH_NORM_BACKWARD |
168 | | #define CMD_BATCH_NORM_BACKWARD(_epsilon, _is_test, _momentum, ...) ccv_nnc_cmd(CCV_NNC_BATCH_NORM_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.bnorm={.epsilon=_epsilon,.is_test=_is_test,.momentum=_momentum,.count=LIST_COUNT(__VA_ARGS__),.axis={__VA_ARGS__}}}), 0) |
169 | | // CCV_NNC_LAYER_NORM_FORWARD |
170 | 16 | #define CMD_LAYER_NORM_FORWARD(_epsilon, _elementwise_affine, ...) ccv_nnc_cmd(CCV_NNC_LAYER_NORM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.lnorm={.epsilon=_epsilon,.elementwise_affine=_elementwise_affine,.count=LIST_COUNT(__VA_ARGS__),.axis={__VA_ARGS__}}}), 0) |
171 | | // CCV_NNC_LAYER_NORM_BACKWARD |
172 | | #define CMD_LAYER_NORM_BACKWARD(_epsilon, _elementwise_affine, ...) ccv_nnc_cmd(CCV_NNC_LAYER_NORM_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.lnorm={.epsilon=_epsilon,.elementwise_affine=_elementwise_affine,.count=LIST_COUNT(__VA_ARGS__),.axis={__VA_ARGS__}}}), 0) |
173 | | // CCV_NNC_GROUP_NORM_FORWARD |
174 | 26 | #define CMD_GROUP_NORM_FORWARD(_group_axis, _groups, _epsilon, _elementwise_affine, ...) ccv_nnc_cmd(CCV_NNC_GROUP_NORM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.gnorm={.group_axis=_group_axis,.groups=_groups,.epsilon=_epsilon,.elementwise_affine=_elementwise_affine,.reduce_count=LIST_COUNT(__VA_ARGS__),.reduce_axis={__VA_ARGS__}}}), 0) |
175 | | // CCV_NNC_GROUP_NORM_BACKWARD |
176 | | #define CMD_GROUP_NORM_BACKWARD(_group_axis, _groups, _epsilon, _elementwise_affine, ...) ccv_nnc_cmd(CCV_NNC_GROUP_NORM_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.gnorm={.group_axis=_group_axis,.groups=_groups,.epsilon=_epsilon,.elementwise_affine=_elementwise_affine,.reduce_count=LIST_COUNT(__VA_ARGS__),.reduce_axis={__VA_ARGS__}}}), 0) |
177 | | // CCV_NNC_RMSNORM_FORWARD |
178 | 8 | #define CMD_RMSNORM_FORWARD(_epsilon, ...) ccv_nnc_cmd(CCV_NNC_RMSNORM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.rmsnorm={.epsilon=_epsilon,.count=LIST_COUNT(__VA_ARGS__),.axis={__VA_ARGS__}}}), 0) |
179 | | // CCV_NNC_RMSNORM_BACKWARD |
180 | | #define CMD_RMSNORM_BACKWARD(_epsilon, ...) ccv_nnc_cmd(CCV_NNC_RMSNORM_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.rmsnorm={.epsilon=_epsilon,.count=LIST_COUNT(__VA_ARGS__),.axis={__VA_ARGS__}}}), 0) |
181 | | // CCV_NNC_PAD_FORWARD |
182 | 17 | #define CMD_PAD_FORWARD(_type, _begin, _end) ccv_nnc_cmd(CCV_NNC_PAD_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={ESCAPE_X16 _begin}},.pad={.type=_type,.end={ESCAPE_X16 _end}}}), 0) |
183 | | // CCV_NNC_PAD_BACKWARD |
184 | 8 | #define CMD_PAD_BACKWARD(_type, _begin, _end) ccv_nnc_cmd(CCV_NNC_PAD_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={ESCAPE_X _begin}},.pad={.type=_type,.end={ESCAPE_X _end}}}), 0) |
185 | | // CCV_NNC_MAX_POOL_FORWARD |
186 | 43 | #define CMD_MAX_POOL_FORWARD(rows, cols) ccv_nnc_cmd(CCV_NNC_MAX_POOL_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={rows, cols,1}}}), 0) |
187 | | // CCV_NNC_MAX_POOL_BACKWARD |
188 | 2 | #define CMD_MAX_POOL_BACKWARD(rows, cols) ccv_nnc_cmd(CCV_NNC_MAX_POOL_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={rows, cols,1}}}), 0) |
189 | | // CCV_NNC_AVERAGE_POOL_FORWARD |
190 | 42 | #define CMD_AVERAGE_POOL_FORWARD(rows, cols) ccv_nnc_cmd(CCV_NNC_AVERAGE_POOL_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={rows, cols,1}}}), 0) |
191 | | // CCV_NNC_AVERAGE_POOL_BACKWARD |
192 | 6 | #define CMD_AVERAGE_POOL_BACKWARD(rows, cols) ccv_nnc_cmd(CCV_NNC_AVERAGE_POOL_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={rows, cols,1}}}), 0) |
193 | | // CCV_NNC_RANDOM_UNIFORM_FORWARD |
194 | 155 | #define CMD_RANDOM_UNIFORM_FORWARD(_lb, _ub) ccv_nnc_cmd(CCV_NNC_RANDOM_UNIFORM_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_lb, _ub}}}, 0) |
195 | | // CCV_NNC_RANDOM_UNIFORM_BACKWARD |
196 | | #define CMD_RANDOM_UNIFORM_BACKWARD(_lb, _ub) ccv_nnc_cmd(CCV_NNC_RANDOM_UNIFORM_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_lb, _ub}}}, 0) |
197 | | // CCV_NNC_RANDOM_NORMAL_FORWARD |
198 | 2 | #define CMD_RANDOM_NORMAL_FORWARD(_std, _mean) ccv_nnc_cmd(CCV_NNC_RANDOM_NORMAL_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_std, _mean}}}, 0) |
199 | | // CCV_NNC_RANDOM_NORMAL_BACKWARD |
200 | | #define CMD_RANDOM_NORMAL_BACKWARD(_std, _mean) ccv_nnc_cmd(CCV_NNC_RANDOM_NORMAL_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_std, _mean}}}, 0) |
201 | | // CCV_NNC_REDUCE_SUM_FORWARD |
202 | 2.03k | #define CMD_REDUCE_SUM_FORWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_SUM_FORWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
203 | | // CCV_NNC_REDUCE_SUM_BACKWARD |
204 | 2 | #define CMD_REDUCE_SUM_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_SUM_BACKWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
205 | | // CCV_NNC_REDUCE_MEAN_FORWARD |
206 | 7 | #define CMD_REDUCE_MEAN_FORWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_MEAN_FORWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
207 | | // CCV_NNC_REDUCE_MEAN_BACKWARD |
208 | 2 | #define CMD_REDUCE_MEAN_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_MEAN_BACKWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
209 | | // CCV_NNC_REDUCE_MAX_FORWARD |
210 | 4 | #define CMD_REDUCE_MAX_FORWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_MAX_FORWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
211 | | // CCV_NNC_REDUCE_MAX_BACKWARD |
212 | | #define CMD_REDUCE_MAX_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_MAX_BACKWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
213 | | // CCV_NNC_REDUCE_MIN_FORWARD |
214 | 3 | #define CMD_REDUCE_MIN_FORWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_MIN_FORWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
215 | | // CCV_NNC_REDUCE_MIN_BACKWARD |
216 | | #define CMD_REDUCE_MIN_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_MIN_BACKWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
217 | | // CCV_NNC_REDUCE_NORM2_FORWARD |
218 | 11 | #define CMD_REDUCE_NORM2_FORWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_NORM2_FORWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
219 | | // CCV_NNC_REDUCE_NORM2_BACKWARD |
220 | 4 | #define CMD_REDUCE_NORM2_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_NORM2_BACKWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
221 | | // CCV_NNC_ARGMAX_FORWARD |
222 | 5 | #define CMD_ARGMAX_FORWARD(...) ccv_nnc_cmd(CCV_NNC_ARGMAX_FORWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
223 | | // CCV_NNC_ARGMAX_BACKWARD |
224 | | #define CMD_ARGMAX_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_ARGMAX_BACKWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
225 | | // CCV_NNC_ARGMIN_FORWARD |
226 | 2 | #define CMD_ARGMIN_FORWARD(...) ccv_nnc_cmd(CCV_NNC_ARGMIN_FORWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
227 | | // CCV_NNC_ARGMIN_BACKWARD |
228 | | #define CMD_ARGMIN_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_ARGMIN_BACKWARD, 0, CMD_REDUCE(__VA_ARGS__), 0) |
229 | | // CCV_NNC_RELU_FORWARD |
230 | 151 | #define CMD_RELU_FORWARD() ccv_nnc_cmd(CCV_NNC_RELU_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
231 | | // CCV_NNC_RELU_BACKWARD |
232 | 2 | #define CMD_RELU_BACKWARD() ccv_nnc_cmd(CCV_NNC_RELU_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
233 | | // CCV_NNC_RMSPROP_FORWARD |
234 | 1.01k | #define CMD_RMSPROP_FORWARD(_rate, _decay, _alpha, _momentum, _epsilon) ccv_nnc_cmd(CCV_NNC_RMSPROP_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.rmsprop={.rate=_rate,.scale=1,.decay=_decay,.alpha=_alpha,.momentum=_momentum,.epsilon=_epsilon}}), 0) |
235 | | // CCV_NNC_LSTM_FORWARD |
236 | 8 | #define CMD_LSTM_FORWARD(_hidden_size, _proj_size, _num_layers, _bias, _batch_first, _bidirectional, _dropout, _is_test) ccv_nnc_cmd(CCV_NNC_LSTM_FORWARD, 0, ((ccv_nnc_cmd_param_t){.rnn={.hidden_size=_hidden_size,.proj_size=_proj_size,.num_layers=_num_layers,.bias=_bias,.batch_first=_batch_first,.bidirectional=_bidirectional,.dropout=_dropout,.is_test=_is_test}}), 0) |
237 | | // CCV_NNC_LSTM_BACKWARD |
238 | 3 | #define CMD_LSTM_BACKWARD(_hidden_size, _proj_size, _num_layers, _bias, _batch_first, _bidirectional, _dropout, _is_test) ccv_nnc_cmd(CCV_NNC_LSTM_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.rnn={.hidden_size=_hidden_size,.proj_size=_proj_size,.num_layers=_num_layers,.bias=_bias,.batch_first=_batch_first,.bidirectional=_bidirectional,.dropout=_dropout,.is_test=_is_test}}), 0) |
239 | | // CCV_NNC_ROI_ALIGN_FORWARD |
240 | 11 | #define CMD_ROI_ALIGN_FORWARD(rows, cols) ccv_nnc_cmd(CCV_NNC_ROI_ALIGN_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={rows, cols,1}}}), 0) |
241 | | // CCV_NNC_ROI_ALIGN_BACKWARD |
242 | 10 | #define CMD_ROI_ALIGN_BACKWARD(rows, cols) ccv_nnc_cmd(CCV_NNC_ROI_ALIGN_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={rows, cols,1}}}), 0) |
243 | | // CCV_NNC_SCALED_DOT_PRODUCT_ATTENTION_FORWARD |
244 | 30 | #define CMD_SCALED_DOT_PRODUCT_ATTENTION_FORWARD(_scale, _is_causal) ccv_nnc_cmd(CCV_NNC_SCALED_DOT_PRODUCT_ATTENTION_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.scaled_dot_product_attention={.scale=_scale,.is_causal=_is_causal}}), 0) |
245 | | // CCV_NNC_SCALED_DOT_PRODUCT_ATTENTION_BACKWARD |
246 | 24 | #define CMD_SCALED_DOT_PRODUCT_ATTENTION_BACKWARD(_scale, _is_causal) ccv_nnc_cmd(CCV_NNC_SCALED_DOT_PRODUCT_ATTENTION_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.scaled_dot_product_attention={.scale=_scale,.is_causal=_is_causal}}), 0) |
247 | | // CCV_NNC_SGD_FORWARD |
248 | 4.48k | #define CMD_SGD_FORWARD(_nesterov, _rate, _scale, _decay, _momentum, _dampening) ccv_nnc_cmd(CCV_NNC_SGD_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.sgd={.nesterov=_nesterov,.rate=_rate,.scale=_scale,.decay=_decay,.momentum=_momentum,.dampening=_dampening}}), 0) |
249 | | // CCV_NNC_SIGMOID_FORWARD |
250 | 16 | #define CMD_SIGMOID_FORWARD() ccv_nnc_cmd(CCV_NNC_SIGMOID_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
251 | | // CCV_NNC_SIGMOID_BACKWARD |
252 | 2 | #define CMD_SIGMOID_BACKWARD() ccv_nnc_cmd(CCV_NNC_SIGMOID_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
253 | | // CCV_NNC_SIGMOID_BINARY_CROSSENTROPY_FORWARD |
254 | 20 | #define CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD_X_0() ccv_nnc_cmd(CCV_NNC_SIGMOID_BINARY_CROSSENTROPY_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.binary_crossentropy={.pos_weight=1}}), 0) |
255 | | #define CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD_X_F(...) ("This should not be used, you should have either 0 parameter or 1 parameters for CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD") |
256 | 17 | #define CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD_X_1(_pos_weight) ccv_nnc_cmd(CCV_NNC_SIGMOID_BINARY_CROSSENTROPY_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.binary_crossentropy={.pos_weight=_pos_weight}}), 0) |
257 | 37 | #define CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD_X_SEL(_0, _1, _FX, ...) _FX |
258 | 37 | #define CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD(...) CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD_X_SEL(CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD_X_F, ##__VA_ARGS__, CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD_X_117 , CMD_SIGMOID_BINARY_CROSSENTROPY_FORWARD_X_020 )(__VA_ARGS__) |
259 | | // CCV_NNC_SIGMOID_BINARY_CROSSENTROPY_BACKWARD |
260 | 8 | #define CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD_X_0() ccv_nnc_cmd(CCV_NNC_SIGMOID_BINARY_CROSSENTROPY_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.binary_crossentropy={.pos_weight=1}}), 0) |
261 | | #define CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD_X_F(...) ("This should not be used, you should have either 0 parameter or 2 parameters for CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD") |
262 | 8 | #define CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD_X_1(_pos_weight) ccv_nnc_cmd(CCV_NNC_SIGMOID_BINARY_CROSSENTROPY_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.binary_crossentropy={.pos_weight=_pos_weight}}), 0) |
263 | 16 | #define CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD_X_SEL(_0, _1, _FX, ...) _FX |
264 | 16 | #define CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD(...) CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD_X_SEL(CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD_X_F, ##__VA_ARGS__, CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD_X_18 , CMD_SIGMOID_BINARY_CROSSENTROPY_BACKWARD_X_08 )(__VA_ARGS__) |
265 | | // CCV_NNC_SOFTMAX_FORWARD |
266 | 522 | #define CMD_SOFTMAX_FORWARD() ccv_nnc_cmd(CCV_NNC_SOFTMAX_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
267 | | // CCV_NNC_SOFTMAX_BACKWARD |
268 | 3 | #define CMD_SOFTMAX_BACKWARD() ccv_nnc_cmd(CCV_NNC_SOFTMAX_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
269 | | // CCV_NNC_SOFTMAX_CROSSENTROPY_FORWARD |
270 | 412 | #define CMD_SOFTMAX_CROSSENTROPY_FORWARD_X_0() ccv_nnc_cmd(CCV_NNC_SOFTMAX_CROSSENTROPY_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.label_smoothing={.trim0=0,.trim1=1}}), 0) |
271 | | #define CMD_SOFTMAX_CROSSENTROPY_FORWARD_X_F(...) ("This should not be used, you should have either 0 parameter or 2 parameters for CMD_SOFTMAX_CROSSENTROPY_FORWARD") |
272 | 10 | #define CMD_SOFTMAX_CROSSENTROPY_FORWARD_X_2(_trim0, _trim1) ccv_nnc_cmd(CCV_NNC_SOFTMAX_CROSSENTROPY_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.label_smoothing={.trim0=_trim0,.trim1=_trim1}}), 0) |
273 | 422 | #define CMD_SOFTMAX_CROSSENTROPY_FORWARD_X_SEL(_0, _1, _2, _FX, ...) _FX |
274 | 422 | #define CMD_SOFTMAX_CROSSENTROPY_FORWARD(...) CMD_SOFTMAX_CROSSENTROPY_FORWARD_X_SEL(CMD_SOFTMAX_CROSSENTROPY_FORWARD_X_F, ##__VA_ARGS__, CMD_SOFTMAX_CROSSENTROPY_FORWARD_X_210 , CMD_SOFTMAX_CROSSENTROPY_FORWARD_X_F, CMD_SOFTMAX_CROSSENTROPY_FORWARD_X_0412 )(__VA_ARGS__) |
275 | | // CCV_NNC_SOFTMAX_CROSSENTROPY_BACKWARD |
276 | 205 | #define CMD_SOFTMAX_CROSSENTROPY_BACKWARD_X_0() ccv_nnc_cmd(CCV_NNC_SOFTMAX_CROSSENTROPY_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.label_smoothing={.trim0=0,.trim1=1}}), 0) |
277 | | #define CMD_SOFTMAX_CROSSENTROPY_BACKWARD_X_F(...) ("This should not be used, you should have either 0 parameter or 2 parameters for CMD_SOFTMAX_CROSSENTROPY_BACKWARD") |
278 | 4 | #define CMD_SOFTMAX_CROSSENTROPY_BACKWARD_X_2(_trim0, _trim1) ccv_nnc_cmd(CCV_NNC_SOFTMAX_CROSSENTROPY_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.label_smoothing={.trim0=_trim0,.trim1=_trim1}}), 0) |
279 | 209 | #define CMD_SOFTMAX_CROSSENTROPY_BACKWARD_X_SEL(_0, _1, _2, _FX, ...) _FX |
280 | 209 | #define CMD_SOFTMAX_CROSSENTROPY_BACKWARD(...) CMD_SOFTMAX_CROSSENTROPY_BACKWARD_X_SEL(CMD_SOFTMAX_CROSSENTROPY_BACKWARD_X_F, ##__VA_ARGS__, CMD_SOFTMAX_CROSSENTROPY_BACKWARD_X_24 , CMD_SOFTMAX_CROSSENTROPY_BACKWARD_X_F, CMD_SOFTMAX_CROSSENTROPY_BACKWARD_X_0205 )(__VA_ARGS__) |
281 | | // CCV_NNC_SWISH_FORWARD |
282 | 7 | #define CMD_SWISH_FORWARD() ccv_nnc_cmd(CCV_NNC_SWISH_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
283 | | // CCV_NNC_SWISH_BACKWARD |
284 | 2 | #define CMD_SWISH_BACKWARD() ccv_nnc_cmd(CCV_NNC_SWISH_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
285 | | // CCV_NNC_TANH_FORWARD |
286 | 9 | #define CMD_TANH_FORWARD() ccv_nnc_cmd(CCV_NNC_TANH_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
287 | | // CCV_NNC_TANH_BACKWARD |
288 | 2 | #define CMD_TANH_BACKWARD() ccv_nnc_cmd(CCV_NNC_TANH_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
289 | | // CCV_NNC_UPSAMPLE_FORWARD |
290 | 15 | #define CMD_UPSAMPLE_FORWARD(_type, _width_scale, _height_scale, _align_corners) ccv_nnc_cmd(CCV_NNC_UPSAMPLE_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.upsample={.type=_type,.width_scale=_width_scale,.height_scale=_height_scale,.align_corners=_align_corners}}), 0) |
291 | | // CCV_NNC_UPSAMPLE_BACKWARD |
292 | 20 | #define CMD_UPSAMPLE_BACKWARD(_type, _width_scale, _height_scale, _align_corners) ccv_nnc_cmd(CCV_NNC_UPSAMPLE_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.upsample={.type=_type,.width_scale=_width_scale,.height_scale=_height_scale,.align_corners=_align_corners}}), 0) |
293 | | // CCV_NNC_SET_FORWARD |
294 | 9.85k | #define CMD_SET_FORWARD(_val) ccv_nnc_cmd(CCV_NNC_SET_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_val,}}}, 0) |
295 | | // CCV_NNC_SET_BACKWARD |
296 | | #define CMD_SET_BACKWARD(_val) ccv_nnc_cmd(CCV_NNC_SET_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_val,}}}, 0) |
297 | | // CCV_NNC_MASKED_FILL_FORWARD |
298 | 9 | #define CMD_MASKED_FILL_FORWARD(_eq, _fill) ccv_nnc_cmd(CCV_NNC_MASKED_FILL_FORWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_eq, _fill}}}, 0) |
299 | | // CCV_NNC_MASKED_FILL_BACKWARD |
300 | 5 | #define CMD_MASKED_FILL_BACKWARD(_eq, _fill) ccv_nnc_cmd(CCV_NNC_MASKED_FILL_BACKWARD, 0, (ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.blas={.a={_eq, _fill}}}, 0) |
301 | | // CCV_NNC_DATA_TRANSFER_FORWARD |
302 | 4.60k | #define CMD_DATA_TRANSFER_FORWARD() ccv_nnc_cmd(CCV_NNC_DATA_TRANSFER_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
303 | | // CCV_NNC_DATA_TRANSFER_BACKWARD |
304 | 1 | #define CMD_DATA_TRANSFER_BACKWARD() ccv_nnc_cmd(CCV_NNC_DATA_TRANSFER_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
305 | | // CCV_NNC_FORMAT_TRANSFORM_FORWARD |
306 | 1.04k | #define CMD_FORMAT_TRANSFORM_FORWARD() ccv_nnc_cmd(CCV_NNC_FORMAT_TRANSFORM_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
307 | | // CCV_NNC_FORMAT_TRANSFORM_BACKWARD |
308 | | #define CMD_FORMAT_TRANSFORM_BACKWARD() ccv_nnc_cmd(CCV_NNC_FORMAT_TRANSFORM_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
309 | | // CCV_NNC_TRANSPOSE_FORWARD |
310 | 77 | #define CMD_TRANSPOSE_FORWARD(_axis_a, _axis_b) ccv_nnc_cmd(CCV_NNC_TRANSPOSE_FORWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.transpose={.axis={_axis_a, _axis_b}}}), 0) |
311 | | // CCV_NNC_TRANSPOSE_BACKWARD |
312 | | #define CMD_TRANSPOSE_BACKWARD(_axis_a, _axis_b) ccv_nnc_cmd(CCV_NNC_TRANSPOSE_BACKWARD, 0, ((ccv_nnc_cmd_param_t){.size={.dim={1,1,1}},.transpose={.axis={_axis_a, _axis_b}}}), 0) |
313 | | // CCV_NNC_DATATYPE_CONVERSION_FORWARD |
314 | 262 | #define CMD_DATATYPE_CONVERSION_FORWARD() ccv_nnc_cmd(CCV_NNC_DATATYPE_CONVERSION_FORWARD, 0, ccv_nnc_cmd_auto, 0) |
315 | | // CCV_NNC_DATATYPE_CONVERSION_BACKWARD |
316 | | #define CMD_DATATYPE_CONVERSION_BACKWARD() ccv_nnc_cmd(CCV_NNC_DATATYPE_CONVERSION_BACKWARD, 0, ccv_nnc_cmd_auto, 0) |
317 | | |
318 | | /** @} */ |