Readonly
deviceGet the device for WebGPU.
This property is only available after the first WebGPU inference session is created.
When use with TypeScript, the type of this property is GPUDevice
defined in "@webgpu/types".
Use const device = env.webgpu.device as GPUDevice;
in TypeScript to access this property with correct type.
see comments on Tensor.GpuBufferType for more details about why not use types defined in "@webgpu/types".
Optional
forceSet or get the force fallback adapter flag.
Setting this property only has effect before the first WebGPU inference session is created. The value will be
used as options for navigator.gpu.requestAdapter()
.
See https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions for more details.
undefined
Optional
powerSet or get the power preference.
Setting this property only has effect before the first WebGPU inference session is created. The value will be
used as options for navigator.gpu.requestAdapter()
.
See https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions for more details.
undefined
Optional
profilingSet or get the profiling configuration.
Optional
mode?: "default" | "off"Set or get the profiling mode.
'off'
Optional
ondata?: ((data) => void)Set or get a callback function when a profiling data is received. If not set, the profiling data will be printed to console.
Set or get a callback function when a profiling data is received. If not set, the profiling data will be printed to console.
Optional
profilingSet or get the profiling mode.
Use env.webgpu.profiling.mode
instead. If env.webgpu.profiling.mode
is set, this property will be
ignored.
Optional
validateSet or get whether validate input content.
false
Generated using TypeDoc
Set or get the adapter for WebGPU.
Setting this property only has effect before the first WebGPU inference session is created. The value will be used as the GPU adapter for the underlying WebGPU backend to create GPU device.
If this property is not set, it will be available to get after the first WebGPU inference session is created. The value will be the GPU adapter that created by the underlying WebGPU backend.
When use with TypeScript, the type of this property is
GPUAdapter
defined in "@webgpu/types". Useconst adapter = env.webgpu.adapter as GPUAdapter;
in TypeScript to access this property with correct type.see comments on Tensor.GpuBufferType