Java Code Examples for org.nd4j.autodiff.samediff.SameDiff#parseVariable()

The following examples show how to use org.nd4j.autodiff.samediff.SameDiff#parseVariable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NameTests.java    From nd4j with Apache License 2.0 5 votes vote down vote up
@Test
public void testNameExtraction_1() throws Exception {
    val str = "Name";
    val exp = "Name";

    val pair = SameDiff.parseVariable(str);
    assertEquals(exp, pair.getFirst());
    assertEquals(0, pair.getSecond().intValue());
}
 
Example 2
Source File: NameTests.java    From nd4j with Apache License 2.0 5 votes vote down vote up
@Test
public void testNameExtraction_2() throws Exception {
    val str = "Name_2";
    val exp = "Name_2";

    val pair = SameDiff.parseVariable(str);
    assertEquals(exp, pair.getFirst());
    assertEquals(0, pair.getSecond().intValue());
}
 
Example 3
Source File: NameTests.java    From nd4j with Apache License 2.0 5 votes vote down vote up
@Test
public void testNameExtraction_3() throws Exception {
    val str = "Name_1:2";
    val exp = "Name_1";

    val pair = SameDiff.parseVariable(str);
    assertEquals(exp, pair.getFirst());
    assertEquals(2, pair.getSecond().intValue());
}
 
Example 4
Source File: NameTests.java    From nd4j with Apache License 2.0 5 votes vote down vote up
@Test
public void testNameExtraction_4() throws Exception {
    val str = "Name_1:1:2";
    val exp = "Name_1:1";

    val pair = SameDiff.parseVariable(str);
    assertEquals(exp, pair.getFirst());
    assertEquals(2, pair.getSecond().intValue());
}
 
Example 5
Source File: NameTests.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
@Test
public void testNameExtraction_1() {
    val str = "Name";
    val exp = "Name";

    val pair = SameDiff.parseVariable(str);
    assertEquals(exp, pair.getFirst());
    assertEquals(0, pair.getSecond().intValue());
}
 
Example 6
Source File: NameTests.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
@Test
public void testNameExtraction_2() {
    val str = "Name_2";
    val exp = "Name_2";

    val pair = SameDiff.parseVariable(str);
    assertEquals(exp, pair.getFirst());
    assertEquals(0, pair.getSecond().intValue());
}
 
Example 7
Source File: NameTests.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
@Test
public void testNameExtraction_3() {
    val str = "Name_1:2";
    val exp = "Name_1";

    val pair = SameDiff.parseVariable(str);
    assertEquals(exp, pair.getFirst());
    assertEquals(2, pair.getSecond().intValue());
}
 
Example 8
Source File: NameTests.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
@Test
public void testNameExtraction_4() {
    val str = "Name_1:1:2";
    val exp = "Name_1:1";

    val pair = SameDiff.parseVariable(str);
    assertEquals(exp, pair.getFirst());
    assertEquals(2, pair.getSecond().intValue());
}