Interface InferenceSession

Represent a runtime instance of an ONNX model.

Hierarchy

  • InferenceSession

Properties

inputNames: readonly string[]

Get input names of the loaded model.

outputNames: readonly string[]

Get output names of the loaded model.

Methods

  • Execute the model asynchronously with the given feeds and options.

    Returns

    A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding values.

    Parameters

    • feeds: OnnxValueMapType

      Representation of the model input. See type description of InferenceSession.InputType for detail.

    • Optional options: RunOptions

      Optional. A set of options that controls the behavior of model inference.

    Returns Promise<OnnxValueMapType>

  • Execute the model asynchronously with the given feeds, fetches and options.

    Returns

    A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding values.

    Parameters

    • feeds: OnnxValueMapType

      Representation of the model input. See type description of InferenceSession.InputType for detail.

    • fetches: FetchesType

      Representation of the model output. See type description of InferenceSession.OutputType for detail.

    • Optional options: RunOptions

      Optional. A set of options that controls the behavior of model inference.

    Returns Promise<OnnxValueMapType>

Generated using TypeDoc