The attributes of Slice
See original GitHub issueAsk a Question
Question
When opset version<=9 the node of Slice
have attribute
which stores starts
, end
and axis
. However, opset version >9
there isn’t attribute
, how can I get the value of starts
, ends
and axis
?
Further information
-
I intend to convert
onnx
format ofViT
model toCrypten
. There is a error aboutSlice
whose cause is thatCrypten
requires ‘starts’,ends
andaxis
ofSlice
, but opset version>9onnx
doesn’t haveattribute
, I can’t find thestarts
etc. -
Is this issue related to a specific model?
Model name (e.g. mnist): ViT model and Crypten Model opset (e.g. 7): opset version>=10
Notes
Any additional information, code snippets.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Python slice() - Programiz
The slice() function returns a slice object that is used to slice any sequence (string, tuple, list, range, or bytes). Example. text =...
Read more >Slice Objects — Python 3.11.1 documentation
Return a new slice object with the given values. The start, stop, and step parameters are used as the values of the slice...
Read more >Python slice() Function - W3Schools
The slice() function returns a slice object. A slice object is used to specify how to slice a sequence. You can specify where...
Read more >Attributes in slice segments
You can select and display attributes, custom attributes, and intrinsic attributes on a slice axis. A slice axis can contain multiple segments.
Read more >Slice Objects — Python 3.6.3 documentation
Return a new slice object with the given values. The start, stop, and step parameters are used as the values of the slice...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just to clarify: “210” here is the name of a tensor. You can check whether there is an initializer with that name, which will provide the value. If not, there must be some node with an output named “210”. If it is a “Constant” node, then the value can be obtained from that node’s attributes. Otherwise, it is probably computed at runtime, and so a value cannot be determined statically.
If you didn’t find those input names of Slice node in your graph.initializer/graph.input, they are probably produced while forwarding the graph… That is to say, they are not static and their values can only obtained during runtime (giving inputs and going through the graph).