Env class that holds detected capabilities

Hierarchy

  • Env

Constructors

Properties

Canvas: undefined

MonkeyPatch for Canvas

Image: undefined

MonkeyPatch for Image

ImageData: undefined

MonkeyPatch for ImageData

agent: string = ''

Detected agent

backends: string[] = []

List of supported backends

browser: boolean

Running in Browser

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

CPU info

Type declaration

  • flags: string[]
  • model: undefined | string
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

Type declaration

  • gpu: undefined | boolean
  • version: undefined | string
tfjs: { version: undefined | string }

TFJS instance details

Type declaration

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

WASM detected capabilities

Type declaration

  • backend: undefined | boolean
  • multithread: undefined | boolean
  • simd: undefined | boolean
  • supported: undefined | boolean
webgl: { backend: undefined | boolean; renderer: undefined | string; supported: undefined | boolean; version: undefined | string } = ...

WebGL detected capabilities

Type declaration

  • backend: undefined | boolean
  • renderer: undefined | string
  • supported: undefined | boolean
  • version: undefined | string
webgpu: { adapter: undefined | string; backend: undefined | boolean; supported: undefined | boolean } = ...

WebGPU detected capabilities

Type declaration

  • adapter: undefined | string
  • backend: undefined | boolean
  • supported: undefined | boolean
worker: boolean

Running in WebWorker thread

Methods

  • update backend information

    Returns Promise<void>