Permalink
Browse files

toInts - moved from deeplearning4j/deeplearning4j#2562

  • Loading branch information...
1 parent 1a5148b commit 8d50071bc43f4118ede6c274321163ddda46a538 @pkoperek pkoperek committed Dec 28, 2016
Showing with 9 additions and 0 deletions.
  1. +9 −0 nd4j-common/src/main/java/org/nd4j/linalg/util/ArrayUtil.java
@@ -149,6 +149,15 @@ public static short fromFloat( float v ) {
return ret;
}
+ public static int[] toInts(long[] array) {
+ int[] retVal = new int[array.length];
+
+ for (int i = 0; i < array.length; i++) {
+ retVal[i] = (int) array[i];
+ }
+
+ return retVal;
+ }
/**
* Calculate the offset for a given stride array

0 comments on commit 8d50071

Please sign in to comment.