Skip to content

Slicing with 0d ArraySymbol raises TypeError #327

@p-ortmann

Description

@p-ortmann

Might be a misunderstanding on my part, but I'd expect the below to work:

from dwave.optimization.mathematical import maximum
from dwave.optimization.model import Model

model = Model()
zero = model.constant(0)
one = model.constant(1)
data = model.constant([1, 1])
max = maximum(zero, one)
data[max:] # works fine if you omit the : here

File "dwave/optimization/symbols.pyx", line 604, in dwave.optimization.symbols.BasicIndexing.cppslice
TypeError: 'dwave.optimization.symbols.Maximum' object cannot be interpreted as an integer

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions