question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The attributes of Slice

See original GitHub issue

Ask 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 of ViT model to Crypten. There is a error about Slice whose cause is that Crypten requires ‘starts’, ends and axis of Slice, but opset version>9 onnx doesn’t have attribute, I can’t find the starts 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:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gramalingamcommented, Sep 3, 2021

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.

0reactions
jcwchencommented, Aug 30, 2021

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found