A few bug fixes.

parent 0b54574b
......@@ -46,7 +46,7 @@ public class CheckLayerRecursion implements CNNArchASTLayerDeclarationCoCo {
private void checkForRecursion(LayerDeclarationSymbol startingLayer, ArchitectureElementSymbol current){
if (!done) {
if (current instanceof CompositeElementSymbol) {
for (ArchitectureElementSymbol architectureElement : ((CompositeElementSymbol) current).getElement()) {
for (ArchitectureElementSymbol architectureElement : ((CompositeElementSymbol) current).getElements()) {
checkForRecursion(startingLayer, architectureElement);
}
}
......
......@@ -332,7 +332,7 @@ public class CNNArchSymbolTableCreator extends de.monticore.symboltable.CommonSy
for (ASTArchBody astBody : node.getGroups()){
elements.add((CompositeElementSymbol) astBody.getSymbol().get());
}
compositeElement.setElement(elements);
compositeElement.setElements(elements);
removeCurrentScope();
}
......@@ -352,7 +352,7 @@ public class CNNArchSymbolTableCreator extends de.monticore.symboltable.CommonSy
for (ASTArchitectureElement astElement : ast.getElements()){
elements.add((ArchitectureElementSymbol) astElement.getSymbol().get());
}
compositeElement.setElement(elements);
compositeElement.setElements(elements);
removeCurrentScope();
}
......
......@@ -172,7 +172,7 @@ public class IOSymbol extends ArchitectureElementSymbol {
.build()));
getLayer.setAstNode(getAstNode().get());
serialComposite.setElement(Arrays.asList(getLayer, ioElement));
serialComposite.setElements(Arrays.asList(getLayer, ioElement));
parallelElements.add(serialComposite);
}
......
......@@ -199,7 +199,7 @@ public class CNNArchTemplateController {
ArchitectureElementData previousElement = getCurrentElement();
setCurrentElement(compositeElement);
for (ArchitectureElementSymbol element : compositeElement.getElement()){
for (ArchitectureElementSymbol element : compositeElement.getElements()){
include(element, writer);
}
......
......@@ -71,7 +71,7 @@ public class LayerNameCreator {
int lastIndex = streamIndices.size() - 1;
List<Integer> endStages = new ArrayList<>();
for (ArchitectureElementSymbol subElement : compositeElement.getElement()){
for (ArchitectureElementSymbol subElement : compositeElement.getElements()){
endStages.add(name(subElement, startStage, streamIndices));
streamIndices.set(lastIndex, streamIndices.get(lastIndex) + 1);
}
......@@ -81,7 +81,7 @@ public class LayerNameCreator {
}
else {
int endStage = stage;
for (ArchitectureElementSymbol subElement : compositeElement.getElement()){
for (ArchitectureElementSymbol subElement : compositeElement.getElements()){
endStage = name(subElement, endStage, streamIndices);
}
return endStage;
......
......@@ -68,7 +68,6 @@ public class GenerationTest {
private String readFileFromResources(String relativePath) throws IOException{
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource(relativePath).getFile());
StringBuilder stringBuilder = new StringBuilder();
Scanner scanner = new Scanner(file);
scanner.useDelimiter("\\Z");
String content = scanner.next() + "\n";
......
......@@ -93,9 +93,9 @@ public class InstanceTest extends AbstractSymtabTest {
CNNArchCompilationUnitSymbol compilationUnit2 = compilationUnitSymbol.preResolveDeepCopy();
compilationUnit2.setParameter("cardinality", 2);
ArchitectureSymbol instance2 = compilationUnit2.resolve();
ArchRangeExpressionSymbol range1 = (ArchRangeExpressionSymbol) ((LayerSymbol)(((CompositeElementSymbol)((CompositeElementSymbol)((CompositeElementSymbol)((CompositeElementSymbol) instance1.getBody()).getElement().get(5).getResolvedThis().get()).getElement().get(0)).getElement().get(0)).getElement().get(0)))
ArchRangeExpressionSymbol range1 = (ArchRangeExpressionSymbol) ((LayerSymbol)(((CompositeElementSymbol)((CompositeElementSymbol)((CompositeElementSymbol)((CompositeElementSymbol) instance1.getBody()).getElements().get(5).getResolvedThis().get()).getElements().get(0)).getElements().get(0)).getElements().get(0)))
.getArgument(AllPredefinedVariables.PARALLEL_ARG_NAME).get().getRhs();
ArchRangeExpressionSymbol range2 = (ArchRangeExpressionSymbol) ((LayerSymbol)(((CompositeElementSymbol)((CompositeElementSymbol)((CompositeElementSymbol)((CompositeElementSymbol) instance2.getBody()).getElement().get(5).getResolvedThis().get()).getElement().get(0)).getElement().get(0)).getElement().get(0)))
ArchRangeExpressionSymbol range2 = (ArchRangeExpressionSymbol) ((LayerSymbol)(((CompositeElementSymbol)((CompositeElementSymbol)((CompositeElementSymbol)((CompositeElementSymbol) instance2.getBody()).getElements().get(5).getResolvedThis().get()).getElements().get(0)).getElements().get(0)).getElements().get(0)))
.getArgument(AllPredefinedVariables.PARALLEL_ARG_NAME).get().getRhs();
assertEquals(32, range1.getElements().get().size());
......
......@@ -45,8 +45,7 @@ public class AllCoCoTest extends AbstractCoCoTest {
}
@Test
public void testValidCoCos() throws IOException {
public void testValidCoCos(){
checkValid("architectures", "ResNet152");
checkValid("architectures", "Alexnet");
checkValid("architectures", "ResNeXt50");
......@@ -68,7 +67,6 @@ public class AllCoCoTest extends AbstractCoCoTest {
checkValid("valid_tests", "ResNeXt50_alt");
checkValid("valid_tests", "Alexnet_alt2");
checkValid("valid_tests", "MultipleOutputs");
}
@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