Replace where condition

Is there a Condition that works for elementwise comparison of two INDArrays?

Essentially I have want to compare two arrays, and replace any entries that are not equal with zero.

This would be something like:

      Nd4j.valueArrayOf(data.shape, replacement).castTo(DataType.DOUBLE),

Except comparing each point to a single value, we compare it to the same index in a different array.

I think I fumbled my way to an answer:

  1. Use a mask created with data.match(comp, condition)
  2. Use that mask with data.putWhereWithMask(mask, replacementData)

I found out the hard way that these operations are in place.