diff --git a/package.json b/package.json index 16b119a9cf..2588de3267 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/semver": "^7.3.9", "@types/shelljs": "^0.8.7", "@types/dom-webcodecs": "0.1.4", - "@webgpu/types": "0.1.38", + "@webgpu/types": "0.1.48", "ajv": "~6.12.3", "argparse": "^1.0.10", "chalk": "~2.4.2", diff --git a/tfjs-backend-webgpu/src/base.ts b/tfjs-backend-webgpu/src/base.ts index 1de43149b0..cf3ac665e2 100644 --- a/tfjs-backend-webgpu/src/base.ts +++ b/tfjs-backend-webgpu/src/base.ts @@ -57,7 +57,13 @@ if (isWebGPUSupported()) { }; const device: GPUDevice = await adapter.requestDevice(deviceDescriptor); - const adapterInfo = await adapter.requestAdapterInfo(); + const adapterInfo = + 'info' in adapter + ? adapter.info + : 'requestAdapterInfo' in adapter + // tslint:disable-next-line:no-any + ? await (adapter as any).requestAdapterInfo() + : undefined; return new WebGPUBackend(device, adapterInfo); }, 3 /*priority*/); } diff --git a/yarn.lock b/yarn.lock index 69db9f15c6..1f1f69345a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -513,10 +513,10 @@ resolved "https://registry.yarnpkg.com/@verdaccio/ui-theme/-/ui-theme-6.0.0-6-next.23.tgz#268da5091e1e9264fe87b8b94c0ac596e9e54879" integrity sha512-GXpEPdZJm6o+2VAxzUsKaiDriS+5enqr7Gjrb2Bttcd+IkOuC8lDsoFHxIv0ib4JudZJ/aKsRYL3TN2AetPFjw== -"@webgpu/types@0.1.38": - version "0.1.38" - resolved "https://registry.npmjs.org/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" - integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== +"@webgpu/types@0.1.48": + version "0.1.48" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.48.tgz#8ab741852283118bd633345c20e218faa7211e9c" + integrity sha512-e3zmDEPih4Rle+JrP5cT8nCCtDizoUpEaN72OuD1clbhXGERtn0wwuMdxOrBymu3kMLWKDd8hd+ERhSheLuLTg== "@xmldom/xmldom@^0.7.3": version "0.7.5"