-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from JingyuanZhang/beta
feat(core): support model frame & get fetch info in another way
- Loading branch information
Showing
12 changed files
with
161 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
packages/paddlejs-backend-webgpu/test/model/mock/model.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{ | ||
"ops": [ | ||
{ | ||
"attrs": { | ||
"__@kernel_type_attr@__": "feed/def/1/4/2" | ||
}, | ||
"inputs": { | ||
"X": [ | ||
"feed" | ||
] | ||
}, | ||
"outputs": { | ||
"Out": [ | ||
"image" | ||
] | ||
}, | ||
"type": "feed" | ||
}, | ||
{ | ||
"attrs": { | ||
"axis": 1, | ||
"use_mkldnn": false, | ||
"x_data_format": "", | ||
"y_data_format": "" | ||
}, | ||
"inputs": { | ||
"X": [ | ||
"image" | ||
], | ||
"Y": [ | ||
"fc7_offset" | ||
] | ||
}, | ||
"outputs": { | ||
"Out": [ | ||
"fc_0.tmp_1" | ||
] | ||
}, | ||
"type": "elementwise_add" | ||
}, | ||
{ | ||
"attrs": { | ||
"x_num_col_dims": 1, | ||
"y_num_col_dims": 1 | ||
}, | ||
"inputs": { | ||
"X": ["fc_0.tmp_1"], | ||
"Y": ["fc7_weights"] | ||
}, | ||
"outputs": { | ||
"Out": ["fc_0.tmp_0"] | ||
}, | ||
"type": "mul" | ||
}, | ||
{ | ||
"attrs": { | ||
"__@kernel_type_attr@__": "fetch/def/1/4/2", | ||
"data_type": 1 | ||
}, | ||
"inputs": { | ||
"X": [ | ||
"fc_0.tmp_0" | ||
] | ||
}, | ||
"outputs": { | ||
"Out": [ | ||
"fetch" | ||
] | ||
}, | ||
"type": "fetch" | ||
} | ||
], | ||
"vars": [ | ||
{ | ||
"name": "fc_0.tmp_1", | ||
"persistable": false, | ||
"shape": [1, 1, 2, 4] | ||
}, | ||
{ | ||
"data": [1, 1 , 1, 1, 1, 1, 1, 1], | ||
"name": "fc7_offset", | ||
"persistable": true, | ||
"shape": [ | ||
1, 1, 2, 4 | ||
] | ||
}, | ||
{ | ||
"data": [4, 1, 0, -1, 1, 3, 2, 0, 1, 1, 3, 4], | ||
"name": "fc7_weights", | ||
"persistable": true, | ||
"shape": [1, 1, 4, 3] | ||
}, | ||
{ | ||
"name": "fc_0.tmp_0", | ||
"persistable": false, | ||
"shape": [1, 1, 2, 3] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Runner } from 'paddlejs-core/src/index'; | ||
import registerWebGPUBackend from '../../src/index'; | ||
|
||
const modelDir = `/test/model/mock/`; | ||
const modelPath = `${modelDir}model.json`; | ||
|
||
async function run() { | ||
const runner = new Runner({ | ||
modelPath, | ||
feedShape: { | ||
fw: 4, | ||
fh: 2 | ||
} | ||
}); | ||
await runner.init(); | ||
console.log(runner.weightMap); | ||
console.log(await runner.preheat()); | ||
} | ||
|
||
registerWebGPUBackend(); | ||
run(); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 5 additions & 6 deletions
11
...es/paddlejs-backend-webgpu/test/opTest.js → ...paddlejs-backend-webgpu/test/op/opTest.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters