# Class Env

Env class that holds detected capabilities

#### Hierarchy

- Env

- Defined in src/util/env.ts:5

#####
Index

### Constructors

constructor

### Properties

agent
backends
browser
cpu
filter
initial
kernels
node
offscreen
perfadd
platform
tensorflow
tfjs
wasm
webgl
webgpu
worker

### Accessors

Canvas
Image
ImageData

### Methods

updateBackend
updateCPU

## Constructors

### constructor

- new Env(): Env

- #### Returns Env

  - Defined in src/util/env.ts:101

## Properties

### agent

agent: string = ''

Detected agent

- Defined in src/util/env.ts:15

### backends

backends: string[] = []

List of supported backends

- Defined in src/util/env.ts:17

### browser

browser: boolean

Running in Browser

- Defined in src/util/env.ts:7

### cpu

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

CPU info

#### Type declaration

- ##### flags: string[]

- ##### model: undefined | string

- Defined in src/util/env.ts:77

### filter

filter: undefined | boolean

Are image filters supported?

- Defined in src/util/env.ts:21

### initial

initial: boolean

Has any work been performed so far

- Defined in src/util/env.ts:19

### kernels

kernels: string[] = []

List of supported kernels for current backend

- Defined in src/util/env.ts:85

### node

node: boolean

Running in NodeJS

- Defined in src/util/env.ts:9

### offscreen

offscreen: undefined | boolean

Is offscreenCanvas supported?

- Defined in src/util/env.ts:27

### perfadd

perfadd: boolean = false

Are performance counter instant values or additive

- Defined in src/util/env.ts:29

### platform

platform: string = ''

Detected platform

- Defined in src/util/env.ts:13

### tensorflow

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

- Defined in src/util/env.ts:31

### tfjs

tfjs: {
version: undefined | string;
}

TFJS instance details

#### Type declaration

- ##### version: undefined | string

- Defined in src/util/env.ts:23

### wasm

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

- Defined in src/util/env.ts:39

### webgl

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

WebGL detected capabilities

#### Type declaration

- ##### backend: undefined | boolean

- ##### renderer: undefined | string

- ##### shader: undefined | string

- ##### supported: undefined | boolean

- ##### vendor: undefined | string

- ##### version: undefined | string

- Defined in src/util/env.ts:51

### webgpu

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

WebGPU detected capabilities

#### Type declaration

- ##### adapter: undefined | GPUAdapterInfo

- ##### backend: undefined | boolean

- ##### supported: undefined | boolean

- Defined in src/util/env.ts:67

### worker

worker: boolean

Running in WebWorker thread

- Defined in src/util/env.ts:11

## Accessors

### Canvas

- get Canvas(): undefined

- #### Returns undefined

  - Defined in src/util/env.ts:92
- set Canvas(val: undefined): void

- #### Parameters

  - ##### val: undefined

  #### Returns void

  - Defined in src/util/env.ts:93

### Image

- get Image(): undefined

- #### Returns undefined

  - Defined in src/util/env.ts:94
- set Image(val: undefined): void

- #### Parameters

  - ##### val: undefined

  #### Returns void

  - Defined in src/util/env.ts:96

### ImageData

- get ImageData(): undefined

- #### Returns undefined

  - Defined in src/util/env.ts:97
- set ImageData(val: undefined): void

- #### Parameters

  - ##### val: undefined

  #### Returns void

  - Defined in src/util/env.ts:99

## Methods

### updateBackend

- updateBackend(): Promise<void>

- update backend information

  #### Returns Promise<void>

  - Defined in src/util/env.ts:127

### updateCPU

- updateCPU(): void

- update cpu information

  #### Returns void

  - Defined in src/util/env.ts:168