main.es6 779 字节
Newer Older
W
wangqun 已提交
1 2 3 4 5 6 7 8 9 10
/* eslint-disable */
/**
 * @file concat主函数
 * @author zhangjingyuan02
 */
export default `
// start函数
void main(void) {
    ivec4 oPos = getOutputTensorPos();
    // 输出坐标转换为输入坐标
W
wangqun 已提交
11 12
//	int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out + oPos.r * channel_out * width_shape_out * height_shape_out;
 //   ivec4 new_oPos = transferFromNHWCtoNCHW(sumVal, channel_out, width_shape_out, height_shape_out, total_shape_out);
W
wangqun 已提交
13
    float o = 0.0;
14 15
    if (oPos[dim] > inputs_dim - 1) {
        oPos[dim] = oPos[dim] - inputs_dim;
W
wangqun 已提交
16
        o = getValueFromTensorPos_counter(oPos.r, oPos.g, oPos.b, oPos.a);
W
wangqun 已提交
17 18
    }
    else {
W
wangqun 已提交
19
        o = getValueFromTensorPos_origin(oPos.r, oPos.g, oPos.b, oPos.a);
W
wangqun 已提交
20 21 22 23
    }
	setOutput(float(o));
}
`;