E.g. I have x = [1 , 2, 3]. I want y = 1/x = [1, 1/2, 1/3].
Ideally, I want a function that works the same way as the following line taken from the nd4j documentation, only for the multiplicative inverse instead of the hyperbolic tangent.
INDArray tanh = Nd4j.getExecutioner().execAndReturn(new Tanh(myArr))
If there isn't such a function, is there a more efficient, or at least cleaner, way to do a custom elementwise operation on an array than using a for loop and inverting each value individually?