microsoft / microsoft/onnxruntime

how to implement TypeAndShapeInferenceFunction when create new op by custom op?

Open
#14,728 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

hi, now I want to create a new op by custom op.
like this [https://github.com/microsoft/onnxruntime/tree/main/onnxruntime/test/testdata/custom_op_library](url)

I need to implement a shape inference logic in this op, i can't find a interface to implement it.

how to implement it?

thanks

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

Review the custom-op example at onnxruntime/test/testdata/custom_op_library and search the repository for TypeAndShapeInferenceFunction and custom-op registration entry points. Clarify the supported interface and identify the relevant example or documentation location; done means a newcomer can follow it to implement shape inference.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.