Permalink
Browse files

add test for base64 testing of arrays (#1165)

  • Loading branch information...
1 parent e6e0dff commit f3b286a762c6c786d05d20bce01fb98c6d4baa95 @agibsonccc agibsonccc committed on GitHub Jul 31, 2016
View
0 change-scala-versions.sh 100644 → 100755
No changes.
@@ -24,6 +24,7 @@ public void testBase64Several() throws IOException {
public void testBase64() throws Exception {
INDArray arr = Nd4j.linspace(1,4,4);
String base64 = Nd4jBase64.base64String(arr);
+ assertTrue(Nd4jBase64.isMultiple(base64));
INDArray from = Nd4jBase64.fromBase64(base64);
assertEquals(arr,from);
}
@@ -17,9 +17,21 @@ private Nd4jBase64() {
}
/**
+ * Returns true if the base64
+ * contains multiple arrays
+ * This is delimited by tab
+ * @param base64 the base 64 to test
+ * @return true if the given base 64
+ * is tab delimited or not
+ */
+ public static boolean isMultiple(String base64) {
+ return base64.contains("\t");
+ }
+
+ /**
* Returns a set of arrays
* from base 64 that is tab delimited.
- * @param base64 the base 64 that's tab delmited
+ * @param base64 the base 64 that's tab delimited
* @return the set of arrays
*/
public static INDArray[] arraysFromBase64(String base64) throws IOException {

0 comments on commit f3b286a

Please sign in to comment.