Env class that holds detected capabilities

Constructors

Properties

agent: string = ''

Detected agent

backends: string[] = []

List of supported backends

browser: boolean

Running in Browser

cpu: {
    flags: string[];
    model: undefined | string;
} = ...

CPU info

filter: undefined | boolean

Are image filters supported?

initial: boolean

Has any work been performed so far

kernels: string[] = []

List of supported kernels for current backend

node: boolean

Running in NodeJS

offscreen: undefined | boolean

Is offscreenCanvas supported?

perfadd: boolean = false

Are performance counter instant values or additive

platform: string = ''

Detected platform

tensorflow: {
    gpu: undefined | boolean;
    version: undefined | string;
} = ...

If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled

tfjs: {
    version: undefined | string;
}

TFJS instance details

wasm: {
    backend: undefined | boolean;
    multithread: undefined | boolean;
    simd: undefined | boolean;
    supported: undefined | boolean;
} = ...

WASM detected capabilities

webgl: {
    backend: undefined | boolean;
    renderer: undefined | string;
    shader: undefined | string;
    supported: undefined | boolean;
    vendor: undefined | string;
    version: undefined | string;
} = ...

WebGL detected capabilities

webgpu: {
    adapter: undefined | GPUAdapterInfo;
    backend: undefined | boolean;
    supported: undefined | boolean;
} = ...

WebGPU detected capabilities

worker: boolean

Running in WebWorker thread

Accessors

Methods

  • update backend information

    Returns Promise<void>