microsoft / microsoft/onnxruntime

[Feature Request] Java API: OnnxSequence and OnnxMap as inputs to session.run

Open
#17,218 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api:Java feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the feature request

Support `OnnxSequence` and `OnnxMap` as inputs to `session.run`, i.e have Map as input.

### Describe scenario use case

I wanted to run onnx models, which take in `OnnxSequence`, `OnnxMap` as inputs, this is supported in the python API, but it seems the [Java API only supports](https://github.com/microsoft/onnxruntime/blob/main/java/src/main/java/ai/onnxruntime/OrtSession.java#L258) `OnnxTensorLike` input type. Is there a plan to support this in the near future, also in the meantime is there a workaround to run such models with the java API?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in java/src/main/java/ai/onnxruntime/OrtSession.java at the input type referenced around line 258, and compare the requested behavior with the Python API's sequence and map support. Trace how session.run accepts existing OnnxValue types; done means Map inputs containing OnnxSequence and OnnxMap are accepted for models that require them.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.