dwavesystems / dwavesystems/dwave-optimization

Bad input to the ``broadcast_to`` function triggers an internal-check error

Open
#505 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
31
Forks
36
Avg merge
16h 55m
Merged PRs (30d)
8

Description

The ``broadcast_to`` below triggers an error

```
>>> broadcast_to(model.constant([[2, 3], [4, 5]]), model.constant(5))
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
```

on the code checking for whether the symbol needs to be reshaped or not: ``if x.shape() == shape or (isinstance(shape, int) and x.shape() == (shape,))``

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.