0

I started working with ND4j recently and came upon an issue I don't have an explanation for.

INDArray test =
        Nd4j.create(new double[] {1.0, 1.0, 2.0, 1.0}, new long[] {2, 2}, DataType.UINT16);
BooleanIndexing.replaceWhere(test, 0.0, Conditions.greaterThan(0)); // test not updated

INDArray testCasted = test.castTo(DataType.FLOAT);
BooleanIndexing.replaceWhere(testCasted, 0.0, Conditions.greaterThan(0)); // testCasted is updated

In the code above, an array created with UINT16 datatype doesn't get updated by the replaceWhere function. But when the array is casted to a FLOAT, replaceWhere works as expected. Why is this?

1 Answers1

0

For now just use cast. Please feel free to file an issue and we'll take a look at that at: https://github.com/eclipse/deeplearning4j/issues - it's likely just us forgetting to auto update some of the types. Thanks!

Adam Gibson
  • 3,055
  • 1
  • 10
  • 12