33 float input[1*1*2*3] = {
34 -3, 2.5, 2, -2.1, 7.8, 100
40 operands[0].
data = input;
41 operands[0].
dims[0] = 1;
42 operands[0].
dims[1] = 1;
43 operands[0].
dims[2] = 2;
44 operands[0].
dims[3] = 3;
50 output = operands[1].
data;
51 for (
int i = 0;
i <
sizeof(input) /
sizeof(
float);
i++) {
52 float expected_output = input[
i] > params.
val.
y ? input[
i] : params.
val.
y;
53 if (
fabs(output[
i] - expected_output) >
EPSON) {
54 printf(
"at index %d, output: %f, expected_output: %f\n",
i, output[
i], expected_output);
65 int main(
int argc,
char **argv)
static __device__ float fabs(float a)
int main(int argc, char **argv)
int ff_dnn_execute_layer_maximum(DnnOperand *operands, const int32_t *input_operand_indexes, int32_t output_operand_index, const void *parameters, NativeContext *ctx)
DNN inference functions interface for native backend.
union DnnLayerMaximumParams::@202 val
void * data
data pointer with data length in bytes.
int32_t dims[4]
there are two memory layouts, NHWC or NCHW, so we use dims, dims[0] is Number.