0

I am trying to create an INDArray of zeros with the following code:

var testArray = Nd4j.zeros(3,4)

However I got the following error:

<console>:71: error: ambiguous reference to overloaded definition,
both method zeros in object Nd4j of type (x$1: Int*)org.nd4j.linalg.api.ndarray.INDArray
and  method zeros in object Nd4j of type (x$1: Long, x$2: Long)org.nd4j.linalg.api.ndarray.INDArray
match argument types (Int,Int)
       var testArray = Nd4j.zeros(3,4)

Any advice on how to solve this?

Andronicus
  • 25,419
  • 17
  • 47
  • 88

2 Answers2

2

One of the easiest methods would be to explicitly declare parameters as long:

var testArray = Nd4j.zeros(3L, 4L)
Andronicus
  • 25,419
  • 17
  • 47
  • 88
0

For those who encounter this in later versions of ND4S when calling arr.getDouble, this is solved by explicitly turning your variables to long, e.g arr.getDouble(0L)

Ali
  • 261,656
  • 265
  • 575
  • 769