Skip to content

[IR] Unsupported slice and ellipsis indexes to iter a graph #2302

Closed
@Johansmm

Description

@Johansmm

Code to reproduce the error:

import onnx
from onnxscript import ir

model = onnx.parser.parse_model(
"""<ir_version: 10, opset_import: [ "" : 17]>
     agraph (float[N] x) => (float[N] z) {
         y = Sigmoid(x)
         z = Mul(y, y)  
     }""")
ir_model = ir.from_proto(model)
ir_model.graph[0:]

Error logs

Errors when executing ir_model.graph[0:]:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "onnxscript\ir\_core.py", line 2232, in __getitem__
    return self._nodes[index]
           ~~~~~~~~~~~^^^^^^^
  File "onnxscript\ir\_linked_list.py", line 144, in __getitem__
    if index >= self._length or index < -self._length:
       ^^^^^^^^^^^^^^^^^^^^^
TypeError: '>=' not supported between instances of 'slice' and 'int'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions