Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
CNNArch2X
Commits
75b5ea72
Commit
75b5ea72
authored
Jul 27, 2021
by
lr119628
Browse files
[update]: added isPresent() check in nameAdaNetBlock in LayerNameCreator
parent
75291479
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/generator/LayerNameCreator.java
View file @
75b5ea72
...
...
@@ -57,12 +57,15 @@ public class LayerNameCreator {
}
}
protected
int
nameAdaNetBlock
(
String
target
,
ArchitectureElementSymbol
subElement
,
int
endStage
,
List
<
Integer
>
streamIndices
){
ArchitectureElementSymbol
currentBlock
=
((
AdaNet
)
((
LayerSymbol
)
subElement
).
getDeclaration
()).
getBlock
(
target
).
get
();
if
(
currentBlock
.
isArtificial
())
{
boolean
oldState
=
currentBlock
.
containsAdaNet
();
currentBlock
.
setAdaNet
(
true
);
endStage
=
name
(
currentBlock
,
endStage
,
streamIndices
);
currentBlock
.
setAdaNet
(
oldState
);
Optional
<
ArchitectureElementSymbol
>
currentBlock
=
((
AdaNet
)
((
LayerSymbol
)
subElement
).
getDeclaration
()).
getBlock
(
target
);
if
(
currentBlock
.
isPresent
())
{
if
(
currentBlock
.
get
().
isArtificial
())
{
boolean
oldState
=
currentBlock
.
get
().
containsAdaNet
();
currentBlock
.
get
().
setAdaNet
(
true
);
endStage
=
name
(
currentBlock
.
get
(),
endStage
,
streamIndices
);
currentBlock
.
get
().
setAdaNet
(
oldState
);
}
}
return
endStage
;
}
...
...
@@ -73,6 +76,7 @@ public class LayerNameCreator {
endStage
=
name
(
subElement
,
endStage
,
streamIndices
);
}
else
if
(
subElement
.
getName
().
equals
(
AllPredefinedLayers
.
AdaNet_Name
))
{
// name outBlock
endStage
=
nameAdaNetBlock
(
AllPredefinedLayers
.
Out
,
subElement
,
endStage
,
streamIndices
);
// name inBlock
endStage
=
nameAdaNetBlock
(
AllPredefinedLayers
.
In
,
subElement
,
endStage
,
streamIndices
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment