EnzymeAD / EnzymeAD/Reactant.jl
Indexing an Array with Another Array
- Dominant language
- Julia
- Stars
- 370
- Forks
- 74
- Avg merge
- 18h 47m
- Merged PRs (30d)
- 30
Description
I'm working on a project where we have 2 arrays: one flattened matrix of values that representing a non-square (NxN) array, and one vector of start and end points. If we call these arrays `data` and `indices`, we could work with like `data[1:9]` then `data[10:15]`, so it is inconsistent.
We have a function that indexes the data array as `data[indices[1]:indices[2]]`, then `data[indices[2]:indices[3]]` and so on in a loop. This crashes, with the error
```ERROR: LoadError: TypeError: non-boolean (Reactant.TracedRNumber{Bool}) used in boolean context```
How would I go about achieving this goal in a Reactant friendly way?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.