Replies: 2 comments
-
Bumping, was this solved? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Calling |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the most efficient way to update one value or one dimension in let's say 2D NDArray?
It appears that setting a value at [row, col] is allocating DirectByteBuffer for that single value and I can't seem to find a proper way of updating a single row or a single column with either ByteArray or other data structure.
On the other hand, I tried taking advantage of slicing and updating that slice with values from ByteArray for a single row or column however it appears a slice will create a copy and won't let me mutate it by reference.
Here is what I tried:
but that will create a copy of a column and update that instead of updating the underlying.
In short, I'm looking for managing frequent updates to a reasonably large matrices and need an efficient way of doing so. If I take a standard
NDArray.set(index, double[])
approach its leaking way too much off heap allocation and causes OOMs andNDArray.set(index, number)
would result in even more allocations just smaller.Any guidance would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions