Skip to content

Commit

Permalink
Upgrade tfjs repo to 4.0.0 (#6927)
Browse files Browse the repository at this point in the history
This major release upgrades TypeScript from 3.5.3 to 4.8.4 (#6346). It is intended to be as non-breaking as possible, but it technically has breaking changes for users of `typescript<4.4`. All other users should be unaffected.

When compiling projects that depend on TFJS with `typescript<4.4`, the following error will appear.
```
node_modules/@webgpu/types/dist/index.d.ts:587:16 - error TS2304: Cannot find name 'PredefinedColorSpace'.

587   colorSpace?: PredefinedColorSpace;
                   ~~~~~~~~~~~~~~~~~~~~
...
```
This can be fixed by upgrading TypeScript to 4.4.2 or greater, or by adding the file `predefined_color_space.d.ts` (name and path can be changed) with the following contents to your project to define the missing type. If this file is added, it will need to be removed when TypeScript is upgraded past 4.3.
```typescript
type PredefinedColorSpace = "display-p3" | "srgb";
```

`typescript<3.7` has the following additional error.
```
node_modules/@tensorflow/tfjs-core/dist/engine.d.ts:127:9 - error TS1086: An accessor cannot be declared in an ambient context.

127     get backend(): KernelBackend;
            ~~~~~~~
...
```

Enabling [`skipLibCheck`](https://www.typescriptlang.org/tsconfig#skipLibCheck) suppresses this error, and upgrading to at least TypeScript 3.6.2 fixes it (although the above fix for `PredefinedColorSpace` will also need to be applied).
  • Loading branch information
mattsoulanille authored Oct 12, 2022
1 parent 567754e commit 8571f49
Show file tree
Hide file tree
Showing 57 changed files with 1,329 additions and 424 deletions.
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"tsify": "^3.0.4",
"tslint": "^6.1.3",
"tslint-no-circular-imports": "~0.7.0",
"typescript": "3.5.3"
"typescript": "4.8.4"
},
"scripts": {
"build": "tsc",
Expand Down
21 changes: 13 additions & 8 deletions e2e/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,15 @@
"@types/node" "*"
form-data "^3.0.0"

"@types/node@*", "@types/node@>=10.0.0":
version "17.0.23"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da"
integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==
"@types/node@*":
version "17.0.19"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.19.tgz#726171367f404bfbe8512ba608a09ebad810c7e6"
integrity sha512-PfeQhvcMR4cPFVuYfBN4ifG7p9c+Dlh3yUZR6k+5yQK7wX3gDgVxBly4/WkBRs9x4dmcy1TVl08SY67wwtEvmA==

"@types/node@>=10.0.0":
version "14.14.36"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.36.tgz#5637905dbb15c30a33a3c65b9ef7c20e3c85ebad"
integrity sha512-kjivUwDJfIjngzbhooRnOLhGYz6oRFi+L+EpMjxroDYXwDw9lHrJJ43E+dJ6KAd3V3WxWAJ/qZE9XKYHhjPOFQ==

"@types/offscreencanvas@~2019.3.0":
version "2019.3.0"
Expand Down Expand Up @@ -4028,10 +4033,10 @@ typed-function@^2.0.0:
resolved "https://registry.yarnpkg.com/typed-function/-/typed-function-2.1.0.tgz#ded6f8a442ba8749ff3fe75bc41419c8d46ccc3f"
integrity sha512-bctQIOqx2iVbWGDGPWwIm18QScpu2XRmkC19D8rQGFsjKSgteq/o1hTZvIG/wuDq8fanpBDrLkLq+aEN/6y5XQ==

typescript@3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"
integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==
typescript@4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==

ua-parser-js@^0.7.30:
version "0.7.31"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"@types/mkdirp": "^0.5.2",
"@types/node": "^12.7.5",
"@types/node-fetch": "~2.1.2",
"@types/offscreencanvas": "~2019.3.0",
"@types/offscreencanvas": "^2019.7.0",
"@types/rollup-plugin-visualizer": "^4.2.1",
"@types/seedrandom": "^2.4.28",
"@types/shelljs": "^0.8.7",
"@types/webgl-ext": "0.0.30",
"@types/webgl2": "0.0.6",
"@webgpu/types": "0.1.16",
"@webgpu/types": "0.1.21",
"ajv": "~6.12.3",
"argparse": "^1.0.10",
"chalk": "~2.4.2",
Expand Down Expand Up @@ -68,7 +68,7 @@
"tslib": "^2.4.0",
"tslint": "^6.1.3",
"tslint-no-circular-imports": "~0.7.0",
"typescript": "3.5.3"
"typescript": "4.8.4"
},
"scripts": {
"lint": "tslint -p tsconfig_tslint.json",
Expand Down
2 changes: 1 addition & 1 deletion tfjs-automl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"ts-node": "^8.8.2",
"tslint": "~6.1.3",
"tslint-no-circular-imports": "^0.7.0",
"typescript": "3.5.3",
"typescript": "4.8.4",
"yalc": "~1.0.0-pre.21"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions tfjs-automl/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3737,10 +3737,10 @@ type-is@~1.6.17:
media-typer "0.3.0"
mime-types "~2.1.24"

typescript@3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"
integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==
typescript@4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==

ua-parser-js@^0.7.30:
version "0.7.31"
Expand Down
4 changes: 2 additions & 2 deletions tfjs-backend-webgl/src/canvas_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ function getWebGLRenderingContext(

if (webGLVersion === 1) {
return (canvas.getContext('webgl', WEBGL_ATTRIBUTES) ||
canvas.getContext('experimental-webgl', WEBGL_ATTRIBUTES)) as
WebGLRenderingContext;
(canvas as HTMLCanvasElement)
.getContext('experimental-webgl', WEBGL_ATTRIBUTES));
}
return canvas.getContext('webgl2', WEBGL_ATTRIBUTES) as WebGLRenderingContext;
}
2 changes: 1 addition & 1 deletion tfjs-backend-webgl/src/kernels/FromPixels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function fromPixels(args: {
willReadFrequently = newWillReadFrequently;
fromPixels2DContext =
document.createElement('canvas').getContext(
'2d', {willReadFrequently}) as CanvasRenderingContext2D;
'2d', {willReadFrequently});
}

fromPixels2DContext.canvas.width = width;
Expand Down
1 change: 1 addition & 0 deletions tfjs-backend-webgpu/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ ts_library(
"//tfjs-backend-cpu/src:tfjs-backend-cpu_src_lib",
"//tfjs-core/src:tfjs-core_lib",
"//tfjs-core/src:tfjs-core_src_lib",
"@npm//@types/offscreencanvas",
"@npm//@webgpu/types",
],
)
Expand Down
2 changes: 1 addition & 1 deletion tfjs-backend-webgpu/src/kernels/FromPixels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function fromPixels(args: {
willReadFrequently = newWillReadFrequently;
fromPixels2DContext =
document.createElement('canvas').getContext(
'2d', {willReadFrequently}) as CanvasRenderingContext2D;
'2d', {willReadFrequently});
}
fromPixels2DContext.canvas.width = width;
fromPixels2DContext.canvas.height = height;
Expand Down
62 changes: 1 addition & 61 deletions tfjs-backend-webgpu/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -909,36 +909,11 @@
resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080"
integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==

"@types/long@^4.0.1":
version "4.0.2"
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a"
integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==

"@types/node@>=10.0.0":
version "16.4.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.12.tgz#961e3091f263e6345d2d84afab4e047a60b4b11b"
integrity sha512-zxrTNFl9Z8boMJXs6ieqZP0wAhvkdzmHSxTlJabM16cf5G9xBc1uPRH5Bbv2omEDDiM8MzTfqTJXBf0Ba4xFWA==

"@types/offscreencanvas@~2019.3.0":
version "2019.3.0"
resolved "https://registry.yarnpkg.com/@types/offscreencanvas/-/offscreencanvas-2019.3.0.tgz#3336428ec7e9180cf4566dfea5da04eb586a6553"
integrity sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==

"@types/seedrandom@^2.4.28":
version "2.4.30"
resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.30.tgz#d2efe425869b84163c2d56e779dddadb9372cbfa"
integrity sha512-AnxLHewubLVzoF/A4qdxBGHCKifw8cY32iro3DQX9TPcetE95zBeVt3jnsvtvAUf1vwzMfwzp4t/L2yqPlnjkQ==

"@types/[email protected]":
version "0.0.30"
resolved "https://registry.yarnpkg.com/@types/webgl-ext/-/webgl-ext-0.0.30.tgz#0ce498c16a41a23d15289e0b844d945b25f0fb9d"
integrity sha512-LKVgNmBxN0BbljJrVUwkxwRYqzsAEPcZOe6S2T6ZaBDIrFp0qu4FNlpc5sM1tGbXUYFgdVQIoeLk1Y1UoblyEg==

"@webgpu/types@^0.1.16":
version "0.1.21"
resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.21.tgz#b181202daec30d66ccd67264de23814cfd176d3a"
integrity sha512-pUrWq3V5PiSGFLeLxoGqReTZmiiXwY3jRkIG5sLLKjyqNxrwm/04b4nw7LSmGWJcKk59XOM/YRTUwOzo4MMlow==

accepts@~1.3.4:
version "1.3.7"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd"
Expand Down Expand Up @@ -2154,7 +2129,7 @@ istanbul-reports@^3.0.0:
html-escaper "^2.0.0"
istanbul-lib-report "^3.0.0"

jasmine-core@^4.1.0, jasmine-core@^4.2.0:
jasmine-core@^4.1.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-4.2.0.tgz#0605bea284d6d78276f43c47de2532ecd4a73b00"
integrity sha512-OcFpBrIhnbmb9wfI8cqPSJ50pv3Wg4/NSgoZIqHzIwO/2a9qivJWzv8hUvaREIMYYJBas6AvfXATFdVuzzCqVw==
Expand Down Expand Up @@ -2347,11 +2322,6 @@ log4js@^6.3.0, log4js@^6.4.1:
rfdc "^1.3.0"
streamroller "^3.0.2"

[email protected]:
version "4.0.0"
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==

magic-string@^0.25.7:
version "0.25.7"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051"
Expand Down Expand Up @@ -2459,13 +2429,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==

node-fetch@~2.6.1:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
dependencies:
whatwg-url "^5.0.0"

node-releases@^1.1.73:
version "1.1.73"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20"
Expand Down Expand Up @@ -2807,11 +2770,6 @@ safe-buffer@~5.1.1:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

seedrandom@^3.0.5:
version "3.0.5"
resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.5.tgz#54edc85c95222525b0c7a6f6b3543d8e0b3aa0a7"
integrity sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==

[email protected]:
version "7.0.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
Expand Down Expand Up @@ -3037,11 +2995,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==

tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==

tty-browserify@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811"
Expand Down Expand Up @@ -3155,19 +3108,6 @@ wcwidth@^1.0.1:
dependencies:
defaults "^1.0.3"

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==

whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"

which-boxed-primitive@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"
Expand Down
2 changes: 1 addition & 1 deletion tfjs-converter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"opn": "~5.1.0",
"protobufjs": "~6.11.3",
"ts-node": "~8.8.2",
"typescript": "3.5.3",
"typescript": "4.8.4",
"yalc": "~1.0.0-pre.50"
},
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion tfjs-converter/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ ts_library(
name = "tfjs-converter_test_lib",
testonly = True,
srcs = glob(TEST_SRCS),
module_name = "@tensorflow/tfjs-converter/dist",
deps = [
":tfjs-converter_lib",
":tfjs-converter_src_lib",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ describe('arithmetic', () => {
node.op = op;
executeOp(node, {input1, input2}, context, spyOpsAsTfOps);

// TODO(mattsoulanille): Remove type assertion after TS4
expect(spyOps[uncapitalize(op) as keyof typeof spyOps])
expect(spyOps[uncapitalize(op)])
.toHaveBeenCalledWith(input1[0], input2[0]);
});
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,10 @@ describe('basic math', () => {
.forEach(op => {
it('should call tfOps.' + op, () => {
node.op = op;
// TODO(mattsoulanille): Remove type assertion after TS4
// tslint:disable-next-line no-any
(spyOps[uncapitalize(op) as keyof typeof spyOps] as any)
.and.returnValue({});
spyOps[uncapitalize(op)].and.returnValue({});
executeOp(node, {input1}, context, spyOpsAsTfOps);

// TODO(mattsoulanille): Remove type assertion after TS4
expect(spyOps[uncapitalize(op) as keyof typeof spyOps])
.toHaveBeenCalledWith(input1[0]);
expect(spyOps[uncapitalize(op)]).toHaveBeenCalledWith(input1[0]);
});
it('should match op def', () => {
node.op = op;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,10 @@ describe('logical', () => {
.forEach(op => {
it('should call tfOps.' + op, () => {
node.op = op;
// TODO(mattsoulanille): Remove type assertions after TS4
// tslint:disable-next-line no-any
(spyOps[uncapitalize(op) as keyof typeof spyOps] as any)
.and.returnValue({});
spyOps[uncapitalize(op)].and.returnValue({});
executeOp(node, {input1, input2}, context, spyOpsAsTfOps);

// TODO(mattsoulanille): Remove type assertion after TS4
expect(spyOps[uncapitalize(op) as keyof typeof spyOps])
expect(spyOps[uncapitalize(op)])
.toHaveBeenCalledWith(input1[0], input2[0]);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,10 @@ describe('reduction', () => {
node.op = op;
node.attrParams.keepDims = createBoolAttr(true);
node.attrParams.axis = createNumberAttr(1);
// TODO(mattsoulanille): Remove type assertions after TS4
// tslint:disable-next-line no-any
(spyOps[uncapitalize(op) as keyof typeof spyOps] as any)
.and.returnValue({});
spyOps[uncapitalize(op)].and.returnValue({});
executeOp(node, {input1}, context, spyOpsAsTfOps);

// TODO(mattsoulanille): Remove type assertion after TS4
expect(spyOps[uncapitalize(op) as keyof typeof spyOps])
expect(spyOps[uncapitalize(op)])
.toHaveBeenCalledWith(input1[0], 1, true);
});
});
Expand Down
5 changes: 2 additions & 3 deletions tfjs-converter/src/operations/executors/test_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export function validateParam(
return matched;
}

// TODO(mattsoulanille): Change the return type to Uncapitalize<Name> in TS4.
export function uncapitalize<Name extends string>(name: Name): string {
return name.charAt(0).toLowerCase() + name.slice(1);
export function uncapitalize<Name extends string>(name: Name): Uncapitalize<Name> {
return name.charAt(0).toLowerCase() + name.slice(1) as Uncapitalize<Name>;
}
13 changes: 9 additions & 4 deletions tfjs-converter/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,15 @@ ts-node@~8.8.2:
source-map-support "^0.5.6"
yn "3.1.1"

[email protected]:
version "3.5.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"
integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==
[email protected]:
version "4.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==

universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==

universalify@^0.1.0:
version "0.1.2"
Expand Down
4 changes: 2 additions & 2 deletions tfjs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
},
"dependencies": {
"@types/long": "^4.0.1",
"@types/offscreencanvas": "~2019.3.0",
"@types/offscreencanvas": "~2019.7.0",
"@types/seedrandom": "^2.4.28",
"@types/webgl-ext": "0.0.30",
"@webgpu/types": "0.1.16",
"@webgpu/types": "0.1.21",
"long": "4.0.0",
"node-fetch": "~2.6.1",
"seedrandom": "^3.0.5"
Expand Down
7 changes: 6 additions & 1 deletion tfjs-core/scripts/test_snippets/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ function getJSDocTag(symbol: ts.Symbol): JSDoc {
for (let i = 0; i < tags.length; i++) {
const jsdocTag = tags[i];
if (jsdocTag.name === 'doc' && jsdocTag.text != null) {
const json = convertDocStringToDocInfoObject(jsdocTag.text.trim());
if (jsdocTag.text.length !== 1) {
throw new Error('Expected exactly one jsdoc SymbolDisplayPart but got'
+ ` ${jsdocTag.text.length} instead: ${jsdocTag.text}`);
}
const text = jsdocTag.text[0].text.trim();
const json = convertDocStringToDocInfoObject(text);
return json;
}
}
Expand Down
2 changes: 2 additions & 0 deletions tfjs-core/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ ts_library(
"@npm//@types/jasmine",
"@npm//@types/long",
"@npm//@types/node",
"@npm//@types/offscreencanvas",
"@npm//@types/seedrandom",
"@npm//@webgpu/types",
"@npm//jasmine",
Expand Down Expand Up @@ -232,6 +233,7 @@ ts_library(
":tfjs-core_lib",
":tfjs-core_src_lib",
"//tfjs-backend-cpu/src:tfjs-backend-cpu_lib",
"@npm//@types/offscreencanvas",
],
)

Expand Down
Loading

0 comments on commit 8571f49

Please sign in to comment.