Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 ND4j 库在 JAVA 中重写这行 python 代码。
data[index_odd] = tmp[::-1,:]
它反转列的元素。(换句话说,行的顺序)我使用了这一行,但显然它只在 end>begin 时起作用
INDArrayIndex rev_idx = NDArrayIndex.interval(10, 1);
我提前感谢您的帮助
我以一种非常讨厌的方式解决了我的问题 :)) 我将与您分享。但是,如果您有一个可靠的答案,我将不胜感激。
int[] idx = new int[(int) OBJ_imag.shape()[0]]; for(int i = 0 ; i<OBJ_imag.shape()[0] ; i ++) idx[i] = (int) (OBJ_imag.shape()[0] - i -1); imag.put(indx, OBJ_imag.getRows(idx));