58 const DnnOperand *input = &operands[input_operand_indexes[0]];
59 DnnOperand *output = &operands[output_operand_index];
65 for (
int i = 0;
i < 4; ++
i)
84 switch (params->
un_op) {
86 for (
int i = 0;
i < dims_count; ++
i)
90 for (
int i = 0;
i < dims_count; ++
i)
94 for (
int i = 0;
i < dims_count; ++
i)
98 for (
int i = 0;
i < dims_count; ++
i)
102 for (
int i = 0;
i < dims_count; ++
i)
103 dst[
i] = asin(
src[
i]);
106 for (
int i = 0;
i < dims_count; ++
i)
107 dst[
i] = acos(
src[
i]);
110 for (
int i = 0;
i < dims_count; ++
i)
111 dst[
i] = atan(
src[
i]);
114 for (
int i = 0;
i < dims_count; ++
i)
115 dst[
i] = sinh(
src[
i]);
118 for (
int i = 0;
i < dims_count; ++
i)
119 dst[
i] = cosh(
src[
i]);
122 for (
int i = 0;
i < dims_count; ++
i)
123 dst[
i] = tanh(
src[
i]);
126 for (
int i = 0;
i < dims_count; ++
i)
127 dst[
i] = asinh(
src[
i]);
130 for (
int i = 0;
i < dims_count; ++
i)
131 dst[
i] = acosh(
src[
i]);
134 for (
int i = 0;
i < dims_count; ++
i)
135 dst[
i] = atanh(
src[
i]);
138 for (
int i = 0;
i < dims_count; ++
i)
142 for (
int i = 0;
i < dims_count; ++
i)
146 for (
int i = 0;
i < dims_count; ++
i)
simple assert() macros that are a bit more flexible than ISO C assert().
unsigned int avio_rl32(AVIOContext *s)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static __device__ float ceil(float a)
static __device__ float floor(float a)
int32_t ff_calculate_operand_dims_count(const DnnOperand *oprd)
int32_t ff_calculate_operand_data_length(const DnnOperand *oprd)
DNN inference functions interface for native backend.
int ff_dnn_load_layer_math_unary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
int ff_dnn_execute_layer_math_unary(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.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_realloc(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory.
static av_always_inline av_const double round(double x)
DNNMathUnaryOperation un_op
void * data
data pointer with data length in bytes.
DNNDataType data_type
support different kinds of data type such as float, half float, int8 etc, first support float now.
int32_t dims[4]
there are two memory layouts, NHWC or NCHW, so we use dims, dims[0] is Number.
int32_t input_operand_indexes[4]
a layer can have multiple inputs and one output.
int32_t output_operand_index