Replies: 1 comment 1 reply
-
Can you try PyTorch engine or MXNet engine? For TensorFlow, we didn't implement modify the tensor by index. see: https://github.com/deepjavalibrary/djl/blob/master/engines/tensorflow/tensorflow-engine/src/main/java/ai/djl/tensorflow/engine/TfNDArrayIndexer.java#L64 It's not straightforward to add this feature for TensorFlow, but I think it should be possible for CPU and non-string type of tensor. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys, I am new to DJL. I've Googled but no results. I want to replace the new value with NDArray.set function, like this:
but i get a Exception: Exception in thread "main" java.lang.UnsupportedOperationException: Tensor cannot be modified after creation
I‘m working for Windows 11 with Intellij IDEA
gradle file has added dependencies like this:
I also check the TfNDArrayIndexer.set function source code, like this:
public void set(NDArray array, NDIndexFullSlice fullSlice, Number value) { throw new UnsupportedOperationException("Tensor cannot be modified after creation"); }
It's there any way to be able to modify NDArray with given value after creation?
Am I missing something trivial here? Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions