| 1808 | } |
| 1809 | |
| 1810 | void xcustomInit(XlayerData *xlayer_seq, xChangeLayer *currentLayer) |
| 1811 | { |
| 1812 | #if EN_DEBUG_INIT_PRINT |
| 1813 | cout<<"xcustomInit Start : "<<endl; |
| 1814 | #endif |
| 1815 | |
| 1816 | |
| 1817 | for(int iter_i=0;iter_i<xlayer_seq->hw_ops->xcustom_params->input_dims.size();iter_i++){ |
| 1818 | |
| 1819 | currentLayer->input_dims.push_back(xlayer_seq->hw_ops->xcustom_params->input_dims[iter_i]); |
| 1820 | } |
| 1821 | for(int in_i=0;in_i<currentLayer->input_dims.size();in_i++){ |
| 1822 | currentLayer->input_dims[in_i][0]=XBATCH_SIZE; |
| 1823 | } |
| 1824 | for(int iter_i=0;iter_i<xlayer_seq->hw_ops->xcustom_params->output_dims.size();iter_i++){ |
| 1825 | |
| 1826 | currentLayer->output_dims.push_back(xlayer_seq->hw_ops->xcustom_params->output_dims[iter_i]); |
| 1827 | } |
| 1828 | for(int out_i=0;out_i<currentLayer->output_dims.size();out_i++){ |
| 1829 | currentLayer->output_dims[out_i][0]=XBATCH_SIZE; |
| 1830 | } |
| 1831 | for(int iter_i=0;iter_i<xlayer_seq->hw_ops->xcustom_params->output_dim.size();iter_i++){ |
| 1832 | |
| 1833 | currentLayer->output_dim.push_back(xlayer_seq->hw_ops->xcustom_params->output_dim[iter_i]); |
| 1834 | } |
| 1835 | |
| 1836 | currentLayer->output_dim[0]=XBATCH_SIZE; |
| 1837 | |
| 1838 | currentLayer->float_args = xlayer_seq->hw_ops->xcustom_params->float_args; |
| 1839 | currentLayer->string_args = xlayer_seq->hw_ops->xcustom_params->string_args; |
| 1840 | currentLayer->custom_float_params = xlayer_seq->hw_ops->xcustom_params->params; |
| 1841 | currentLayer->params_dims = xlayer_seq->hw_ops->xcustom_params->params_dims; |
| 1842 | currentLayer->custom_layer_type = xlayer_seq->hw_ops->xcustom_params->type; |
| 1843 | currentLayer->custom_reluflag = xlayer_seq->hw_ops->xcustom_params->reluflag; |
| 1844 | |
| 1845 | |
| 1846 | |
| 1847 | #if 0 |
| 1848 | int *scalar_xcustom_args = (int *)currentLayer->params; |
| 1849 | |
| 1850 | printShape(bottomShape); |
| 1851 | |
| 1852 | scalar_xcustom_args[0] = bottomShape.at(1); //in_depth |
| 1853 | scalar_xcustom_args[1] = bottomShape.at(2); //input_h |
| 1854 | scalar_xcustom_args[2] = bottomShape.at(3); //input_w |
| 1855 | |
| 1856 | printShape(topShape); |
| 1857 | |
| 1858 | scalar_xcustom_args[3] = topShape.at(1); //out_depth |
| 1859 | scalar_xcustom_args[4] = topShape.at(2); //output_h |
| 1860 | scalar_xcustom_args[5] = topShape.at(3); //output_w |
| 1861 | #endif |
| 1862 | |
| 1863 | #if 0//EN_DEBUG_INIT_PRINT |
| 1864 | for(int i=0;i<MAX_PARAM_SIZE;i++) |
| 1865 | { |
| 1866 | fprintf(stderr,"\t%d", scalar_xcustom_args[i]); |
| 1867 | } |
no test coverage detected