Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modify Slice attribute #6139

Closed
salanzewei opened this issue May 16, 2024 · 4 comments
Closed

How to modify Slice attribute #6139

salanzewei opened this issue May 16, 2024 · 4 comments
Labels
question Questions about ONNX

Comments

@salanzewei
Copy link

salanzewei commented May 16, 2024

Ask a Question

Question

I want to add steps parametre in Slice node,but I can't get the Slice input parametres,how can I get the Slice input parametres and change it?

Further information

my Slice node input parametres show in the below image,what 's the meaning of const_starts__19?Shouldn't starts be 0 or 1?
捕获2
when I try to get the input parametres,I only get this:inputs: ['model/p_re_lu_2/add:0', 'const_starts__19', 'const_ends__20', 'const_axes__30']how can I create Slice steps parametres and set value?

@salanzewei salanzewei added the question Questions about ONNX label May 16, 2024
@titaiwangms
Copy link

@justinchuby Could you take this? Also, I think using IR might be pretty easy?

@justinchuby
Copy link
Contributor

I think const_starts__19 is the output of a Constant node. To create steps, create a new Constant node with the desired value, then add its output as an input to the Slice node (as a high level process).

@titaiwangms currently the input list in the IR are immutable so users will need to copy the node to a new node. So that's not entirely straightforward but entirely doable.

@titaiwangms
Copy link

@salanzewei
Copy link
Author

Python API: https://github.com/onnx/onnx/blob/main/docs/PythonAPIOverview.md

Thank you so much, I found onnx-graphsurgencan modify node through create a new node and replace old node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions about ONNX
Projects
None yet
Development

No branches or pull requests

3 participants