Replies: 1 comment
-
Use Also, you can use |
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
-
With DJL, I want to write a ‘LambdaBlock’ that takes an NDList as input and returns a same-shaped NDList setting all inputs to 1 (assuming the NDList has only one entry).
The best I came up with is:
new LambdaBlock(x-> new NDList(x.singletonOrThrow().sub(x.singletonOrThrow()).add(1f)))
Is there a way to achieve the same without using subtraction operation (so it would be executed faster)?
Beta Was this translation helpful? Give feedback.
All reactions