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

A set of configurations for session behavior.

### Hierarchy

- SessionOptions

## Index

### Properties

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

## Properties

### Optional enableCpuMemArena

enableCpuMemArena?: boolean

- Defined in inference-session.ts:81

Whether enable CPU memory arena.

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

### Optional enableMemPattern

enableMemPattern?: boolean

- Defined in inference-session.ts:88

Whether enable memory pattern.

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

### Optional enableProfiling

enableProfiling?: boolean

- Defined in inference-session.ts:102

Wether enable profiling.

This setting is a placeholder for a future use.

### Optional executionMode

executionMode?: "sequential" | "parallel"

- Defined in inference-session.ts:95

Execution mode.

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

### Optional executionProviders

executionProviders?: readonly ExecutionProviderConfig []

- Defined in inference-session.ts:53

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.

### Optional extra

extra?: Record<string, unknown>

- Defined in inference-session.ts:153

Store configurations for a session. See https://github.com/microsoft/onnxruntime/blob/master/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"
        }
      }

### Optional graphOptimizationLevel

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

- Defined in inference-session.ts:74

The optimization level.

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

### Optional interOpNumThreads

interOpNumThreads?: number

- Defined in inference-session.ts:67

The inter OP threads number.

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

### Optional intraOpNumThreads

intraOpNumThreads?: number

- Defined in inference-session.ts:60

The intra OP threads number.

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

### Optional logId

logId?: string

- Defined in inference-session.ts:116

Log ID.

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

### Optional logSeverityLevel

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

- Defined in inference-session.ts:124

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

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

### Optional logVerbosityLevel

logVerbosityLevel?: number

- Defined in inference-session.ts:131

Log verbosity level.

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

### Optional profileFilePrefix

profileFilePrefix?: string

- Defined in inference-session.ts:109

File prefix for profiling.

This setting is a placeholder for a future use.

Generated using TypeDoc