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
CNNArch2Gluon
Commits
aaef2c79
Commit
aaef2c79
authored
Aug 17, 2019
by
Sebastian Nickels
Browse files
Fixed another syntax error
parent
ebf64530
Pipeline
#172955
failed with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/resources/templates/gluon/pythonExecute.ftl
View file @
aaef2c79
<#
list
tc.getLayerVariableMembers("batch_size")?keys as member>
$
{
member
}
= mx.nd.zero
e
s(($
{
tc
.join
(
tc
.getLayerVariableMembers
(
"batch_size"
)[
member
]
, ", ")
}
,), ctx=mx_context)
$
{
member
}
= mx.nd.zeros(($
{
tc
.join
(
tc
.getLayerVariableMembers
(
"batch_size"
)[
member
]
, ", ")
}
,), ctx=mx_context)
</#
list
>
<#
list
tc.architecture.outputs as output>
$
{
tc
.getName
(
output
)}
= mx.nd.zero
e
s(($
{
tc
.join
(
output
.ioDeclaration.type.dimensions
,
", "
)}
,), ctx=mx_context)
$
{
tc
.getName
(
output
)}
= mx.nd.zeros(($
{
tc
.join
(
output
.ioDeclaration.type.dimensions
,
", "
)}
,), ctx=mx_context)
</#
list
>
<#
list
tc.architecture.streams as stream>
...
...
src/test/resources/target_code/CNNSupervisedTrainer_Alexnet.py
View file @
aaef2c79
...
...
@@ -136,7 +136,7 @@ class CNNSupervisedTrainer_Alexnet:
predictions_label
=
batch
.
label
[
0
].
as_in_context
(
mx_context
)
with
autograd
.
record
():
predictions_
=
mx
.
nd
.
zero
e
s
((
10
,),
ctx
=
mx_context
)
predictions_
=
mx
.
nd
.
zeros
((
10
,),
ctx
=
mx_context
)
predictions_
=
self
.
_networks
[
0
](
data_
)
...
...
@@ -173,7 +173,7 @@ class CNNSupervisedTrainer_Alexnet:
]
if
True
:
predictions_
=
mx
.
nd
.
zero
e
s
((
10
,),
ctx
=
mx_context
)
predictions_
=
mx
.
nd
.
zeros
((
10
,),
ctx
=
mx_context
)
predictions_
=
self
.
_networks
[
0
](
data_
)
...
...
@@ -194,7 +194,7 @@ class CNNSupervisedTrainer_Alexnet:
]
if
True
:
predictions_
=
mx
.
nd
.
zero
e
s
((
10
,),
ctx
=
mx_context
)
predictions_
=
mx
.
nd
.
zeros
((
10
,),
ctx
=
mx_context
)
predictions_
=
self
.
_networks
[
0
](
data_
)
...
...
src/test/resources/target_code/CNNSupervisedTrainer_CifarClassifierNetwork.py
View file @
aaef2c79
...
...
@@ -136,7 +136,7 @@ class CNNSupervisedTrainer_CifarClassifierNetwork:
softmax_label
=
batch
.
label
[
0
].
as_in_context
(
mx_context
)
with
autograd
.
record
():
softmax_
=
mx
.
nd
.
zero
e
s
((
10
,),
ctx
=
mx_context
)
softmax_
=
mx
.
nd
.
zeros
((
10
,),
ctx
=
mx_context
)
softmax_
=
self
.
_networks
[
0
](
data_
)
...
...
@@ -173,7 +173,7 @@ class CNNSupervisedTrainer_CifarClassifierNetwork:
]
if
True
:
softmax_
=
mx
.
nd
.
zero
e
s
((
10
,),
ctx
=
mx_context
)
softmax_
=
mx
.
nd
.
zeros
((
10
,),
ctx
=
mx_context
)
softmax_
=
self
.
_networks
[
0
](
data_
)
...
...
@@ -194,7 +194,7 @@ class CNNSupervisedTrainer_CifarClassifierNetwork:
]
if
True
:
softmax_
=
mx
.
nd
.
zero
e
s
((
10
,),
ctx
=
mx_context
)
softmax_
=
mx
.
nd
.
zeros
((
10
,),
ctx
=
mx_context
)
softmax_
=
self
.
_networks
[
0
](
data_
)
...
...
src/test/resources/target_code/CNNSupervisedTrainer_VGG16.py
View file @
aaef2c79
...
...
@@ -136,7 +136,7 @@ class CNNSupervisedTrainer_VGG16:
predictions_label
=
batch
.
label
[
0
].
as_in_context
(
mx_context
)
with
autograd
.
record
():
predictions_
=
mx
.
nd
.
zero
e
s
((
1000
,),
ctx
=
mx_context
)
predictions_
=
mx
.
nd
.
zeros
((
1000
,),
ctx
=
mx_context
)
predictions_
=
self
.
_networks
[
0
](
data_
)
...
...
@@ -173,7 +173,7 @@ class CNNSupervisedTrainer_VGG16:
]
if
True
:
predictions_
=
mx
.
nd
.
zero
e
s
((
1000
,),
ctx
=
mx_context
)
predictions_
=
mx
.
nd
.
zeros
((
1000
,),
ctx
=
mx_context
)
predictions_
=
self
.
_networks
[
0
](
data_
)
...
...
@@ -194,7 +194,7 @@ class CNNSupervisedTrainer_VGG16:
]
if
True
:
predictions_
=
mx
.
nd
.
zero
e
s
((
1000
,),
ctx
=
mx_context
)
predictions_
=
mx
.
nd
.
zeros
((
1000
,),
ctx
=
mx_context
)
predictions_
=
self
.
_networks
[
0
](
data_
)
...
...
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