Skip to content

Commit 84a3287

Browse files
committed
feat: split op support sections arg
1 parent 83a6edb commit 84a3287

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • packages/paddlejs-backend-webgl/src/ops/shader

packages/paddlejs-backend-webgl/src/ops/shader/split.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44

55
function mainFunc(
66
{},
7-
{ target_length, num, dim }
7+
{ target_length, num, dim, sections }
88
) {
9+
10+
const splitChip = sections && sections.length > 1 ? sections[0] : target_length / num;
11+
912
return `
1013
// start函数
1114
void main(void) {
12-
int length = int(${target_length} / ${num});
15+
int length = int(${splitChip});
1316
ivec4 oPos = getOutputTensorPos();
1417
// 输出坐标转换为输入坐标
1518
oPos[${dim}] = oPos[${dim}] + layer_run_time * length;

0 commit comments

Comments
 (0)