removed first condition to check also sublayers in case of CompositeElementSymbol and IOSymbol.

parent c18c2cf5
Pipeline #106706 passed with stages
in 4 minutes and 58 seconds
...@@ -51,8 +51,7 @@ public class CNNArch2Caffe2 implements CNNArchGenerator{ ...@@ -51,8 +51,7 @@ public class CNNArch2Caffe2 implements CNNArchGenerator{
private boolean isSupportedLayer(ArchitectureElementSymbol element, LayerSupportChecker layerChecker){ private boolean isSupportedLayer(ArchitectureElementSymbol element, LayerSupportChecker layerChecker){
List<ArchitectureElementSymbol> constructLayerElemList; List<ArchitectureElementSymbol> constructLayerElemList;
//first part of if condition ensures that element is not an IOSymbol if (element.getResolvedThis().get() instanceof CompositeElementSymbol) {
if (element instanceof LayerSymbol && (element.getResolvedThis().get() instanceof CompositeElementSymbol)) {
constructLayerElemList = ((CompositeElementSymbol)element.getResolvedThis().get()).getElements(); constructLayerElemList = ((CompositeElementSymbol)element.getResolvedThis().get()).getElements();
for (ArchitectureElementSymbol constructedLayerElement : constructLayerElemList) { for (ArchitectureElementSymbol constructedLayerElement : constructLayerElemList) {
if (!isSupportedLayer(constructedLayerElement, layerChecker)) { if (!isSupportedLayer(constructedLayerElement, layerChecker)) {
......
...@@ -136,8 +136,13 @@ public class GenerationTest extends AbstractSymtabTest{ ...@@ -136,8 +136,13 @@ public class GenerationTest extends AbstractSymtabTest{
public void testMultipleOutputs() throws IOException, TemplateException { public void testMultipleOutputs() throws IOException, TemplateException {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/valid_tests", "-r", "MultipleOutputs"}; String[] args = {"-m", "src/test/resources/valid_tests", "-r", "MultipleOutputs"};
exit.expectSystemExit();
exit.checkAssertionAfterwards(new Assertion() {
public void checkAssertion() {
assertTrue(Log.getFindings().size() == 2);
}
});
CNNArch2Caffe2Cli.main(args); CNNArch2Caffe2Cli.main(args);
assertTrue(Log.getFindings().size() == 3);
} }
@Test @Test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment