| 122 | } |
| 123 | |
| 124 | void Custom::custom_norm(const xChangeLayer *xchange){ |
| 125 | |
| 126 | |
| 127 | |
| 128 | float *In_ptr; |
| 129 | |
| 130 | float *out_ptr; |
| 131 | |
| 132 | vector<int> out_dim; |
| 133 | vector<int> in_dim; |
| 134 | int batch ; |
| 135 | int channels; |
| 136 | int height; |
| 137 | int width; |
| 138 | |
| 139 | int iN=0,oN=0; |
| 140 | int off = 0; |
| 141 | |
| 142 | int local_size = (int)xchange->float_args[off+0]; |
| 143 | float alpha = xchange->float_args[off+1]; |
| 144 | float beta =xchange->float_args[off+2]; |
| 145 | for(int it_num_in=0;it_num_in<xchange->input_dims.size();it_num_in++){ |
| 146 | |
| 147 | in_dim=xchange->input_dims[it_num_in]; |
| 148 | |
| 149 | channels = in_dim[1]; |
| 150 | height = in_dim[2]; |
| 151 | width = in_dim[3]; |
| 152 | iN = channels*height*width; |
| 153 | |
| 154 | } |
| 155 | |
| 156 | for(int it_num_out=0;it_num_out<xchange->output_dims.size();it_num_out++){ |
| 157 | |
| 158 | out_dim=xchange->output_dims[it_num_out]; |
| 159 | channels = out_dim[1]; |
| 160 | height = out_dim[2]; |
| 161 | width = out_dim[3]; |
| 162 | oN = channels*height*width; |
| 163 | |
| 164 | } |
| 165 | batch = in_dim[0]; // default batch size = 2 |
| 166 | for(int batch_num=0;batch_num<batch;batch_num++){ |
| 167 | In_ptr = (float*)xchange->in_ptrs[0]+batch_num*iN; |
| 168 | out_ptr = (float*)xchange->out_ptrs[0]+batch_num*oN; |
| 169 | LRN_AcrossChannel(In_ptr, out_ptr, out_dim, local_size, alpha, beta); |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | void func_memcopy(const float *In_ptr,float *out_ptr,int in_height,int in_width,int out_height,int out_width,int depth){ |
| 174 |
nothing calls this directly
no test coverage detected