如何在某个值存在的地方获取索引。在numpy中:
import numpy as np
myArr = np.array()
index = np.where(myArr == someValue)
// Output: an index value consisting rows and cols will be given在ND4J中,我已经到达了这里,但我不知道要在条件参数中放入什么:
INDArray index = myArr.getWhere(someValue, condition=??);换句话说,如何在ND4J中查找INDArray中的元素?
发布于 2020-04-28 02:03:50
我想BooleanIndexing.firstIndex(INDArray,Condition)就是你要找的东西。
发布于 2020-04-28 01:17:21
只需使用Conditions.equals
第一次导入Conditions
import org.nd4j.linalg.indexing.conditions.Conditions;然后:
myArr.getWhere(someValue, Conditions.equals(1));https://stackoverflow.com/questions/61463854
复制相似问题