Skip to content

Conversation

@BruceDai
Copy link
Contributor

@huningxin @fdwr PTAL, thanks.

@@ -0,0 +1,17 @@
# Introduction
These Node.js scripts `gen-<operation-name>.js` in this `tool` folder are used to gerenate / update test data which would be involved into test data JSON files for WebNN operations tests of web-platform-tests project.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate

* @param {String} precisionType
* @return {Array<Number>}
*/
function getPrecisionData(input, precisionType) {
Copy link

@fdwr fdwr Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name sounds odd, because it sounds like it's getting information about the precision itself, rather than casting the data to a given precision. How about getDataCastToPrecision or even clearer castDataToPrecision?

} else {
const targetDataInfo = inputsDataInfo[source];
if (targetDataInfo.data !== undefined) {
const permutation = targetDataInfo.transpose;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, what is transpose used for? Advise a comment here.

if (path.isAbsolute(filePath)) {
inputFile = filePath;
} else {
inputFile =
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] Unwrap line? (it's only 67 characters wide)

// If found, it replaces it by a trio
if ( value instanceof Int8Array ||
value instanceof Uint8Array ||
value instanceof Uint16Array ||
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Int16Array is missing.

Copy link

@fdwr fdwr Dec 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebNN doesn't have either uint16 or int16. https://webmachinelearning.github.io/webnn/#enumdef-mloperandtype So, should we remove Uint16Array?

@BruceDai BruceDai changed the title generate test data for WebNN matmul tests of WPT [WIP] generate test data for WebNN matmul tests of WPT Mar 13, 2023
@fdwr
Copy link

fdwr commented Feb 10, 2024

Has this CR already been superseded by newer ones?

@BruceDai
Copy link
Contributor Author

Has this CR already been superseded by newer ones?

Yes. This PR is earlier version, let me close it and will submit new version, thanks.

@BruceDai BruceDai closed this Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants