Commit a666f9aa authored by Sebastian Nickels's avatar Sebastian Nickels

Added methods to get no duplicate inputs/outputs to CNNArchTemplateController

parent e3002e99
Pipeline #180598 failed with stages
in 2 minutes and 23 seconds
......@@ -171,15 +171,33 @@ public abstract class CNNArchTemplateController {
return list;
}
public List getNoDuplicateArchitectureOutputs(){
List<String> names = new ArrayList();
public List getArchitectureInputSymbols(){
Set<String> names = new HashSet();
List<VariableSymbol> noDuplicates = new ArrayList();
for(VariableSymbol output: getArchitecture().getOutputs()){
if(!names.contains(getName(output))){
for (VariableSymbol inputs : getArchitecture().getInputs()) {
if (getName(inputs) != null && !names.contains(getName(inputs))) {
names.add(getName(inputs));
noDuplicates.add(inputs);
}
}
return noDuplicates;
}
public List getArchitectureOutputSymbols(){
Set<String> names = new HashSet();
List<VariableSymbol> noDuplicates = new ArrayList();
for (VariableSymbol output : getArchitecture().getOutputs()) {
if (getName(output) != null && !names.contains(getName(output))) {
names.add(getName(output));
noDuplicates.add(output);
}
names.add(getName(output));
}
return noDuplicates;
}
......
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