Skip to content

Commit 349cf63

Browse files
authored
fix browser check (#8001)
This change is due to this not working in Deno's NPM compatibility.
1 parent 906cbe3 commit 349cf63

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tfjs-backend-webgpu/src/webgpu_util.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ export function GPUBytesPerElement(dtype: DataType): number {
155155
}
156156

157157
export function isWebGPUSupported(): boolean {
158-
return ((typeof window !== 'undefined') ||
159-
//@ts-ignore
160-
(typeof WorkerGlobalScope !== 'undefined')) &&
161-
!!navigator.gpu;
158+
return !!globalThis.navigator.gpu;
162159
}
163160

164161
export function assertNotComplex(

0 commit comments

Comments
 (0)