我正在尝试使用以下代码创建零的INDArray

var testArray = Nd4j.zeros(3,4)


但是我收到以下错误:

<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)


关于如何解决这个问题的任何建议?

最佳答案

最简单的方法之一是显式声明参数,直到:

var testArray = Nd4j.zeros(3L, 4L)

关于java - 错误:对重载定义的歧义引用,scala中的ND4J,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/60496092/

10-09 05:18