Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cyril Moineau
aidge_core
Commits
f01d1116
Commit
f01d1116
authored
1 year ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Producers should remain outside the micro-graph
parent
5accc679
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/aidge/operator/MetaOperator.hpp
+8
-10
8 additions, 10 deletions
include/aidge/operator/MetaOperator.hpp
with
8 additions
and
10 deletions
include/aidge/operator/MetaOperator.hpp
+
8
−
10
View file @
f01d1116
...
...
@@ -296,18 +296,16 @@ inline std::shared_ptr<Node> PaddedConv(DimSize_t in_channels,
const
std
::
array
<
std
::
array
<
DimSize_t
,
2
>
,
DIM
>
&
padding_dims
=
{
0
},
const
std
::
array
<
DimSize_t
,
DIM
>
&
dilation_dims
=
create_array
<
DimSize_t
,
DIM
>
(
1
))
{
auto
pad
=
Pad
<
DIM
>
(
padding_dims
,
(
!
name
.
empty
())
?
name
+
"_pad"
:
""
);
auto
conv
=
Conv
<
DIM
>
(
in_channels
,
out_channels
,
kernel_dims
,
(
!
name
.
empty
())
?
name
+
"_conv"
:
""
,
stride_dims
,
dilation_dims
);
pad
->
addChild
(
conv
);
// Graph has to be created manually in order to exclude Producers from the graph
auto
graph
=
std
::
make_shared
<
GraphView
>
();
graph
->
add
(
pad
);
graph
->
add
(
conv
,
false
);
// exclude Producers, as they should be inputs of the meta-op
// Construct micro-graph
auto
pad
=
std
::
make_shared
<
Node
>
(
std
::
make_shared
<
Pad_Op
<
static_cast
<
DimIdx_t
>
(
DIM
)
>>
(
padding_dims
,
PadBorderType
::
Constant
,
0.0
),
(
!
name
.
empty
())
?
name
+
"_pad"
:
""
);
auto
conv
=
std
::
make_shared
<
Node
>
(
std
::
make_shared
<
Conv_Op
<
static_cast
<
DimIdx_t
>
(
DIM
)
>>
(
in_channels
,
out_channels
,
kernel_dims
,
stride_dims
,
dilation_dims
),
(
!
name
.
empty
())
?
name
+
"_conv"
:
""
);
// Need to specify the ordered list of input operators
const
std
::
vector
<
NodePtr
>
orderedInputNodes
=
{
pad
,
conv
};
return
std
::
make_shared
<
Node
>
(
std
::
make_shared
<
MetaOperator_Op
>
(
"PaddedConv"
,
graph
,
orderedInputNodes
),
name
);
auto
metaOp
=
std
::
make_shared
<
Node
>
(
std
::
make_shared
<
MetaOperator_Op
>
(
"PaddedConv"
,
Sequential
({
pad
,
conv
}),
orderedInputNodes
),
name
);
addProducer
(
metaOp
,
1
,
append
(
out_channels
,
append
(
in_channels
,
kernel_dims
)),
"w"
);
addProducer
(
metaOp
,
2
,
{
out_channels
},
"b"
);
return
metaOp
;
}
template
<
DimSize_t
DIM
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment