repo stringlengths 1 152 ⌀ | file stringlengths 14 221 | code stringlengths 501 25k | file_length int64 501 25k | avg_line_length float64 20 99.5 | max_line_length int64 21 134 | extension_type stringclasses 2
values |
|---|---|---|---|---|---|---|
Tengine | Tengine-master/executor/operator/ref/kernel/clip/ref_clip_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,448 | 23.559322 | 114 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/clip/ref_clip_uint8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,424 | 32.139535 | 112 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/layernorm_lstm/ref_layernorm_lstm_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,905 | 53.830189 | 124 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/layernorm_lstm/ref_layernorm_lstm_fp16.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,262 | 46.985294 | 118 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/tile/ref_tile_uint8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,291 | 37.847458 | 117 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/tile/ref_tile_fp16.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,185 | 36.050847 | 117 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/tile/ref_tile_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,515 | 24.266667 | 100 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/tile/ref_tile_int8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,274 | 37.559322 | 117 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/tile/ref_tile_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,184 | 35.416667 | 117 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/crop/ref_crop_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,725 | 20.308642 | 75 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/feature_match/ref_feature_match_uint8.c |
static int ref_fm_uint8(const uint8_t* input, uint8_t* output, const uint8_t* weight, const int* bias, feature_match_data* param)
{
int batch = param->batch;
int hidden = param->hidden;
int out_number = param->out_number;
/* dequant input */
int input_size = batch * hidden;
float* input_buf =... | 1,582 | 30.66 | 129 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/feature_match/ref_feature_match_int8.c |
static int ref_fm_int8(const int8_t* input, int8_t* output, const int8_t* weight, const int32_t* bias, feature_match_data* param)
{
int batch = param->batch;
int hidden = param->hidden;
int out_number = param->out_number;
/* malloc output_buffer */
int output_size = batch * out_number;
float*... | 1,288 | 27.644444 | 129 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/feature_match/ref_feature_match_fp16.c |
static int ref_fm_fp16(const __fp16* input, __fp16* output, const __fp16* weight, const __fp16* bias, feature_match_data* param)
{
int batch = param->batch;
int hidden = param->hidden;
int out_number = param->out_number;
int n, i, j;
for(n = 0; n < batch; ++n)
{
for(i = 0; i < out_numb... | 1,288 | 31.225 | 128 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/feature_match/ref_feature_match_fp32.c |
static int ref_fm_fp32(const float* input, float* output, const float* weight, const float* bias, feature_match_data* param)
{
int batch = param->batch;
int hidden = param->hidden;
int out_number = param->out_number;
int n, i, j;
for(n = 0; n < batch; ++n)
{
for(i = 0; i < out_number;... | 751 | 26.851852 | 124 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/strided_slice/ref_strided_slice_uint8.c | static int ref_strided_slice_uint8(uint8_t* in_data, uint8_t* out_data, strided_slice_param* param)
{
int out_chw = param->out_c * param->out_h * param->out_w;
int out_cw = param->out_c * param->out_w;
int in_chw = param->in_c * param->in_h * param->in_w;
int in_cw = param->in_c * param->in_w;
for(i... | 1,029 | 40.2 | 99 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/strided_slice/ref_strided_slice_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,674 | 22.263889 | 91 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/strided_slice/ref_strided_slice_fp16.c | static int ref_strided_slice_fp16(__fp16* in_data, __fp16* out_data, strided_slice_param* param)
{
int out_chw = param->out_c * param->out_h * param->out_w;
int out_cw = param->out_c * param->out_w;
int in_chw = param->in_c * param->in_h * param->in_w;
int in_cw = param->in_c * param->in_w;
for(int ... | 1,027 | 38.538462 | 96 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/strided_slice/ref_strided_slice_int8.c | static int ref_strided_slice_int8(int8_t* in_data, int8_t* out_data, strided_slice_param* param)
{
int out_chw = param->out_c * param->out_h * param->out_w;
int out_cw = param->out_c * param->out_w;
int in_chw = param->in_c * param->in_h * param->in_w;
int in_cw = param->in_c * param->in_w;
for(int ... | 1,026 | 40.08 | 96 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/strided_slice/ref_strided_slice_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,904 | 37.1 | 94 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/reduction/ref_reduce_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,677 | 22.305556 | 109 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/unary/ref_unary_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,542 | 23.492063 | 107 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/unary/ref_unary_uint8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,003 | 32.466667 | 104 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/unary/ref_unary_fp16.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,967 | 32.344538 | 101 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/unary/ref_unary_int8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,477 | 28.226891 | 101 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/unary/ref_unary_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,475 | 28.210084 | 99 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/transpose/ref_transpose_fp32.c | void transpose2d(float* input, float* output, const ref_transpose_param* param){
int out_dim0 = param->in_dims[param->permute[0]];
int out_dim1 = param->in_dims[param->permute[1]];
int in_dim1 = param->in_dims[1];
int inStride[2];
inStride[0] = in_dim1;
inStride[1] = 1;
int stride0 = i... | 7,135 | 32.980952 | 114 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/transpose/ref_transpose_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,414 | 23.824561 | 101 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/topkv2/ref_topkv2_fp16.c | static void swap_fp16(float* p, float* q)
{
float buf;
buf = *p;
*p = *q;
*q = buf;
return;
}
static inline void quick_sort_fp16(float* a, int low, int high, std::vector<int>& indexv)
{
int i = low;
int j = high;
float key = a[low];
if(low >= high) //如果low >= high说明排序结束了
{
... | 2,093 | 26.194805 | 111 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/topkv2/ref_topkv2_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,506 | 21.833333 | 93 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/topkv2/ref_topkv2_uint8.c | static void swap_uint8(uint8_t* p, uint8_t* q)
{
uint8_t buf;
buf = *p;
*p = *q;
*q = buf;
return;
}
static void quick_sort_uint8(uint8_t* a, int low, int high, std::vector<int>& indexv)
{
int i = low;
int j = high;
uint8_t key = a[low];
if(low >= high) //如果low >= high说明排序结束了
... | 1,711 | 24.552239 | 108 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/topkv2/ref_topkv2_int8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,570 | 27.566667 | 105 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/topkv2/ref_topkv2_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,362 | 30.726415 | 103 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/minimum/ref_minimum_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,113 | 32.757576 | 104 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/minimum/ref_minimum_fp16.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,143 | 31.685714 | 107 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/minimum/ref_minimum_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,659 | 23.057971 | 110 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/minimum/ref_minimum_int8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,116 | 32.848485 | 107 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/minimum/ref_minimum_uint8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,117 | 32.878788 | 108 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/rnn/ref_rnn_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,368 | 24.522727 | 113 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/rnn/ref_rnn_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,028 | 33.982759 | 129 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/yolov3detectionoutput/ref_yolov3detectionoutput_fp32.c | float intersection_area(const Box& box1, const Box& box2)
{
//printf("box1:%f %f %f %f\n", box1.x0, box1.x1, box1.y0, box1.y1);
//printf("box2:%f %f %f %f\n", box2.x0, box2.x1, box2.y0, box2.y1);
if(box1.x0 > box2.x1||box1.x1 < box2.x0 ||box1.y0 > box2.y1||box1.y1 < box2.y0)
return 0;
float wid... | 6,288 | 36.658683 | 123 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/convolution/ref_conv_fp16.c |
static inline void activation_fp16(__fp16* input, int activation)
{
#if !defined(__ARM_ARCH) || __ARM_ARCH < 8
float tmp = fp16_to_fp32(*input);
#else
__fp16 tmp = *input;
#endif
if(activation >= 0)
{
if(tmp < 0)
tmp = 0;
if(activation == 1 && tmp > 1)
tmp = 1;
... | 5,527 | 43.224 | 120 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/convolution/ref_conv_fp32.c |
static int ref_conv_fp32(const float* input, float* output, const float* kernel, const float* bias, op_data* param)
{
int batch = param->batch;
int group = param->group;
int input_c = param->in_shape[0] / group;
int input_h = param->in_shape[1];
int input_w = param->in_shape[2];
int output_c =... | 4,614 | 49.163043 | 120 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/convolution/ref_conv_int8.c |
static int ref_conv_int8(const int8_t* input, int8_t* output, const int8_t* kernel, const int32_t* bias, op_data* param)
{
int batch = param->batch;
int group = param->group;
int input_c = param->in_shape[0] / group;
int input_h = param->in_shape[1];
int input_w = param->in_shape[2];
int output... | 5,486 | 45.109244 | 120 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/convolution/ref_conv_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,146 | 22.086022 | 120 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/broadmul/ref_broadmul_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,617 | 21.788732 | 103 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/broadmul/ref_broadmul_fp32.c | static int ref_broadmul_fp32(float* in0,float *in1,float* out, const ref_broadmul_param* param)
{
int out_size = param->out_size;
int in_size = param->in_size;
int on_size = param->on_size;
for(int o = 0; o < out_size; o++)
{
for(int j = 0; j < on_size;j++)
{
float d... | 552 | 24.136364 | 95 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/lrn/ref_lrn_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,645 | 21.547945 | 91 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/lrn/ref_lrn_int8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,566 | 29.75 | 110 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/lrn/ref_lrn_uint8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,058 | 30.536082 | 108 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/lrn/ref_lrn_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,858 | 29.741935 | 110 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/lrn/ref_lrn_fp16.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,051 | 30.142857 | 100 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/priorbox/ref_priorbox_fp32.c | static int ref_priorbox_fp32(float* output, const priorbox_ref_param* param, int elem_size)
{
int num_priors = param->num_priors;
float offset = param->offset;
for(int h = 0; h < param->feature_h; ++h)
{
float* box = output + h * num_priors * 4 * param->feature_w;
for(int w = 0; w < para... | 3,481 | 40.951807 | 91 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/priorbox/ref_priorbox_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,919 | 21.325581 | 99 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/priorbox/ref_priorbox_int8.c | static int ref_priorbox_int8(int8_t* output, priorbox_ref_param* param, int elem_size)
{
float* output_f32 = ( float* )malloc(param->out_dim * 2 * sizeof(float));
int num_priors = param->num_priors;
float offset = param->offset;
for(int h = 0; h < param->feature_h; ++h)
{
float* box = output... | 4,281 | 37.232143 | 87 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/priorbox/ref_priorbox_uint8.c | static int ref_priorbox_uint8(uint8_t* output, const priorbox_ref_param* param, int elem_size)
{
float* output_f32 = ( float* )malloc(param->out_dim * 2 * sizeof(float));
int num_priors = param->num_priors;
float offset = param->offset;
for(int h = 0; h < param->feature_h; ++h)
{
float* box ... | 3,994 | 39.353535 | 94 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/priorbox/ref_priorbox_fp16.c |
static int ref_priorbox_fp16(__fp16* output, const priorbox_ref_param* param, int elem_size)
{
float* output_f32 = ( float* )malloc(elem_size * 2 * sizeof(float));
int num_priors = param->num_priors;
float offset = param->offset;
for(int h = 0; h < param->feature_h; ++h)
{
float* box = out... | 4,217 | 39.171429 | 92 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/l2pool/ref_l2pool_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,034 | 36.469136 | 120 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/l2pool/ref_l2pool_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,781 | 21.275 | 80 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/fully_connected/ref_fc_fp16.c |
static int ref_fc_fp16(const __fp16* input, __fp16* output, const __fp16* weight, const __fp16* bias, fc_data* param)
{
int batch = param->batch;
int hidden = param->hidden;
int out_number = param->out_number;
int n, i, j;
for(n = 0; n < batch; ++n)
{
for(i = 0; i < out_number; ++i)
... | 1,259 | 30.5 | 117 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/fully_connected/ref_fc_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,636 | 22.724638 | 118 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/fully_connected/ref_fc_int8.c |
static int ref_fc_int8(const int8_t* input, int8_t* output, const int8_t* weight, const int32_t* bias, fc_data* param)
{
int batch = param->batch;
int hidden = param->hidden;
int out_number = param->out_number;
/* malloc output_buffer */
int output_size = batch * out_number;
float* output_buf... | 1,268 | 27.2 | 118 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/fully_connected/ref_fc_fp32.c |
static int ref_fc_fp32(const float* input, float* output, const float* weight, const float* bias, fc_data* param)
{
int batch = param->batch;
int hidden = param->hidden;
int out_number = param->out_number;
int n, i, j;
for(n = 0; n < batch; ++n)
{
for(i = 0; i < out_number; ++i)
... | 735 | 26.259259 | 113 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/fully_connected/ref_fc_uint8.c |
static int ref_fc_uint8(const uint8_t* input, uint8_t* output, const uint8_t* weight, const int* bias, fc_data* param)
{
int batch = param->batch;
int hidden = param->hidden;
int out_number = param->out_number;
/* dequant input */
int input_size = batch * hidden;
float* input_buf = ( float* )... | 1,562 | 30.26 | 118 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/swap_axis/ref_swap_axis_int8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,070 | 35.931034 | 97 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/swap_axis/ref_swap_axis_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,297 | 28.844156 | 113 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/swap_axis/ref_swap_axis_uint8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,074 | 36.068966 | 98 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/swap_axis/ref_swap_axis_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,067 | 35.827586 | 96 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/swap_axis/ref_swap_axis_fp16.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,070 | 35.931034 | 97 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/resize/ref_resize_fp16.c |
static void bilinear_resize_fp16(__fp16* inp, __fp16* output, int h, int w, int c, float scale_x, float scale_y, int oh,
int ow)
{
int out_hw = oh * ow;
int in_hw = h * w;
for(int j = 0; j < oh; j++)
{
float fy = (j + 0.5) * scale_y - 0.5;
int sy = floor... | 3,183 | 33.989011 | 120 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/resize/ref_resize_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,722 | 21.973333 | 93 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/detectionOutput/ref_detectionOuput_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,825 | 22.714286 | 111 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/detectionOutput/ref_detectionOutput_fp16.c | void get_boxes_fp16(std::vector<Box>& boxes, int num_prior, const __fp16* loc_ptr, const __fp16* prior_ptr)
{
for(int i = 0; i < num_prior; i++)
{
const __fp16* loc = loc_ptr + i * 4;
const __fp16* pbox = prior_ptr + i * 4;
const __fp16* pvar = pbox + num_prior * 4;
// pbox [xmin... | 4,604 | 31.659574 | 116 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/detectionOutput/ref_detectionOutput_int8.c | void get_boxes_int8(std::vector<Box>& boxes, int num_prior, const int8_t* loc_ptr, const int8_t* prior_ptr,
ddo_param* param_)
{
for(int i = 0; i < num_prior; i++)
{
const int8_t* loc = loc_ptr + i * 4;
const int8_t* pbox = prior_ptr + i * 4;
const int8_t* pvar = pbox... | 4,176 | 35.321739 | 116 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/detectionOutput/ref_detectionOutput_fp32.c | void get_boxes(std::vector<Box>& boxes, int num_prior, const float* loc_ptr, const float* prior_ptr)
{
for(int i = 0; i < num_prior; i++)
{
const float* loc = loc_ptr + i * 4;
const float* pbox = prior_ptr + i * 4;
const float* pvar = pbox + num_prior * 4;
// center size
... | 4,660 | 30.281879 | 116 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/batchnorm/ref_batchnorm_int8.c | static int ref_batchnorm_int8(int8_t* input, int8_t* output, ref_batchnorm_param* param)
{
float* scale_mean = param->scale_mean;
float* scale_var_inv = param->scale_var_inv;
float* gamma = param->gamma;
float* beta = param->beta;
int img_size = param->input_c * param->input_h * param->input_w;
... | 2,395 | 34.235294 | 109 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/batchnorm/ref_batchnorm_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,764 | 21.628205 | 105 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/batchnorm/ref_batchnorm_fp16.c | static int ref_batchnorm_fp16(__fp16* input, __fp16* output, const ref_batchnorm_param* param)
{
float* scale_mean = param->scale_mean;
float* scale_var_inv = param->scale_var_inv;
float* gamma = param->gamma;
float* beta = param->beta;
int img_size = param->input_c * param->input_h * param->input_... | 2,156 | 33.790323 | 109 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/batchnorm/ref_batchnorm_uint8.c | static int ref_batchnorm_uint8(uint8_t* input, uint8_t* output, const ref_batchnorm_param* param)
{
float* scale_mean = param->scale_mean;
float* scale_var_inv = param->scale_var_inv;
float* gamma = param->gamma;
float* beta = param->beta;
int img_size = param->input_c * param->input_h * param->inp... | 2,160 | 35.016667 | 109 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/batchnorm/ref_batchnorm_fp32.c | static int ref_batchnorm_fp32(float* input, float* output, const ref_batchnorm_param* param)
{
float* scale_mean = param->scale_mean;
float* scale_var_inv = param->scale_var_inv;
float* gamma = param->gamma;
float* beta = param->beta;
int img_size = param->input_c * param->input_h * param->input_w;... | 1,613 | 34.866667 | 109 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/argmax/ref_argmax_fp32.c | static int ref_argmax_fp32(float* input, int* output, const ref_argmax_param* param)
{
float max_value;
int max_value_index;
float current;
int axis_size = param->axis_size;
int outer_size = param->outer_size;
int inner_size = param->inner_size;
for(int outer = 0; outer < outer_size; ++out... | 910 | 28.387097 | 84 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/argmax/ref_argmax_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,556 | 21.565217 | 93 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/reducel2/ref_reducel2_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,340 | 22.946429 | 83 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/reducel2/ref_reducel2_fp32.c | static int ref_reducel2_fp32(float *in_data,float* out_data,const reducel2_param* param)
{
int in_size = 1;
int out_size = 1;
for(int i = 0; i < param->axis; i++)
{
out_size = out_size * param->dims[i];
}
for(int i = param->axis; i < 4;i++)
{
in_size = in_size * param->d... | 605 | 20.642857 | 88 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/softmax/ref_softmax_uint8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,114 | 33.672131 | 118 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/softmax/ref_softmax_fp16.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,050 | 32.622951 | 113 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/softmax/ref_softmax_int8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,247 | 31.57971 | 113 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/softmax/ref_softmax_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,426 | 32.97619 | 118 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/softmax/ref_softmax_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 2,977 | 24.02521 | 116 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/logical/ref_logical_fp32.c | void logical_and(int input_hw, int input_hw_1, int input_count4, int input1_count4, float* input0, float* input1,
logical_param* param, float* output)
{
if(input1_count4 == 1)
{
for(int i = 0; i < input_count4; ++i)
{
*output++ = (*input0++) && input1[0];
}
}... | 2,243 | 23.659341 | 113 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/interp/ref_interp_fp32.c | int ref_interp_fp32(float* input, float* output,interp_param* param)
{
for (int n = 0; n < param->batch_number; ++n) {
for (int c = 0; c < param->inc; ++c) {
for (int y = 0; y < param->output_height; ++y) {
float in_y = INTERP_MIN(y / param->height_scale, (float)(param->inh - 1));
... | 1,810 | 40.159091 | 121 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/lstm/ref_lstm_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 12,002 | 26.341686 | 120 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/permute/ref_permute_fp16.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,022 | 25.752212 | 99 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/permute/ref_permute_fp32.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,650 | 26.044444 | 97 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/permute/ref_permute_uint8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,039 | 25.902655 | 102 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/permute/ref_permute_int8.c | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 3,684 | 26.296296 | 99 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/permute/ref_permute_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,571 | 21.140845 | 94 | h |
Tengine | Tengine-master/executor/operator/ref/kernel/eltwise/ref_eltwise_int8.c | void elt_prod_int8(int input_hw, int input_hw_1, int input_count4, int input1_count4, int out_size, float* output_buf,
int8_t* input0, int8_t* input1, eltwise_param* param)
{
if(input1_count4 == 1)
{
for(int i = 0; i < input_count4; ++i)
{
float real_input0 = ((*in... | 14,001 | 33.917706 | 119 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/eltwise/ref_eltwise_fp32.c | void elt_prod(int input_hw, int input_hw_1, int input_count4, int input1_count4, float* input0, float* input1,
eltwise_param* param, float* output)
{
if(input1_count4 == 1)
{
for(int i = 0; i < input_count4; ++i)
{
*output++ = (*input0++) * input1[0];
}
}
... | 11,815 | 26.672131 | 111 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/eltwise/ref_eltwise_uint8.c | void elt_prod_uint8(int input_hw, int input_hw_1, int input_count4, int input1_count4, uint8_t* input0, uint8_t* input1,
uint8_t* output, eltwise_param* param)
{
if(input1_count4 == 1)
{
for(int i = 0; i < input_count4; ++i)
{
float real_input0 = ((*input0++) - pa... | 14,838 | 37.643229 | 120 | c |
Tengine | Tengine-master/executor/operator/ref/kernel/eltwise/ref_eltwise_kernel.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... | 1,667 | 21.24 | 93 | h |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.