# SessionOptions | ONNX Runtime JavaScript API
Documentation for ONNX Runtime JavaScript API

# Interface SessionOptions

A set of configurations for session behavior.

#### Hierarchy

- SessionOptions

- Defined in inference-session.ts:46

#####
Index

### Properties

enableCpuMemArena?
enableMemPattern?
enableProfiling?
executionMode?
executionProviders?
extra?
graphOptimizationLevel?
interOpNumThreads?
intraOpNumThreads?
logId?
logSeverityLevel?
logVerbosityLevel?
profileFilePrefix?

## Properties

### `Optional` enableCpuMemArena

enableCpuMemArena?: boolean

Whether enable CPU memory arena.

This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend

- Defined in inference-session.ts:81

### `Optional` enableMemPattern

enableMemPattern?: boolean

Whether enable memory pattern.

This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend

- Defined in inference-session.ts:88

### `Optional` enableProfiling

enableProfiling?: boolean

Wether enable profiling.

This setting is a placeholder for a future use.

- Defined in inference-session.ts:102

### `Optional` executionMode

executionMode?: "sequential" | "parallel"

Execution mode.

This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend

- Defined in inference-session.ts:95

### `Optional` executionProviders

executionProviders?: readonly ExecutionProviderConfig []

An array of execution provider options.

An execution provider option can be a string indicating the name of the execution provider, or an object of corresponding type.

- Defined in inference-session.ts:53

### `Optional` extra

extra?: Record<string, unknown>

Store configurations for a session. See https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/session/ onnxruntime_session_options_config_keys.h

This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later

### Example

    extra: {
      session: {
        set_denormal_as_zero: "1",
        disable_prepacking: "1"
      },
      optimization: {
        enable_gelu_approximation: "1"
      }
    }

- Defined in inference-session.ts:153

### `Optional` graphOptimizationLevel

graphOptimizationLevel?: "basic" | "all" | "disabled" | "extended"

The optimization level.

This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend

- Defined in inference-session.ts:74

### `Optional` interOpNumThreads

interOpNumThreads?: number

The inter OP threads number.

This setting is available only in ONNXRuntime (Node.js binding and react-native).

- Defined in inference-session.ts:67

### `Optional` intraOpNumThreads

intraOpNumThreads?: number

The intra OP threads number.

This setting is available only in ONNXRuntime (Node.js binding and react-native).

- Defined in inference-session.ts:60

### `Optional` logId

logId?: string

Log ID.

This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend

- Defined in inference-session.ts:116

### `Optional` logSeverityLevel

logSeverityLevel?: 0 | 2 | 1 | 3 | 4

Log severity level. See https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/common/logging/severity.h

This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend

- Defined in inference-session.ts:124

### `Optional` logVerbosityLevel

logVerbosityLevel?: number

Log verbosity level.

This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later

- Defined in inference-session.ts:131

### `Optional` profileFilePrefix

profileFilePrefix?: string

File prefix for profiling.

This setting is a placeholder for a future use.

- Defined in inference-session.ts:109

Generated using TypeDoc