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
Iterations
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
Eclipse Projects
aidge
aidge_core
Commits
48de8d5d
Commit
48de8d5d
authored
10 months ago
by
Michal Szczepanski
Browse files
Options
Downloads
Patches
Plain Diff
AllowDataDependency added for resize operator.
parent
8927fffc
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/aidge/operator/Resize.hpp
+1
-1
1 addition, 1 deletion
include/aidge/operator/Resize.hpp
src/operator/Resize.cpp
+24
-6
24 additions, 6 deletions
src/operator/Resize.cpp
with
25 additions
and
7 deletions
include/aidge/operator/Resize.hpp
+
1
−
1
View file @
48de8d5d
...
...
@@ -78,7 +78,7 @@ public:
return
std
::
make_shared
<
Resize_Op
>
(
*
this
);
}
// function se
e in
puts
bool
dimsForwarded
()
const
overrid
e
f
in
al
;
bool
forwardDims
(
bool
allowDataDependency
=
false
)
override
final
;
void
setBackend
(
const
std
::
string
&
name
,
DeviceIdx_t
device
=
0
)
override
final
;
...
...
This diff is collapsed.
Click to expand it.
src/operator/Resize.cpp
+
24
−
6
View file @
48de8d5d
...
...
@@ -25,6 +25,19 @@
const
std
::
string
Aidge
::
Resize_Op
::
Type
=
"Resize"
;
bool
Aidge
::
Resize_Op
::
dimsForwarded
()
const
{
if
((
getInput
(
1
)
&&
!
getInput
(
1
)
->
empty
())
||
(
getInput
(
2
)
&&
!
getInput
(
2
)
->
empty
())
||
(
getInput
(
3
)
&&
!
getInput
(
3
)
->
empty
()))
{
// output dims are data dependent
return
false
;
}
return
OperatorTensor
::
dimsForwarded
();
}
bool
Aidge
::
Resize_Op
::
forwardDims
(
bool
allowDataDependency
)
{
AIDGE_ASSERT
(
getInput
(
0
)
->
nbDims
()
==
4
,
\
...
...
@@ -35,12 +48,6 @@ bool Aidge::Resize_Op::forwardDims(bool allowDataDependency) {
if
(
!
getInput
(
i
))
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"{}: input #{} not provided"
,
type
(),
i
);
}
if
(
!
allowDataDependency
)
{
Log
::
warn
(
"Resize_Op: unable to forwardDims() because output dims are data dependent\
on input#0 and (input#2 or input#3)"
);
return
false
;
}
}
if
(
this
->
template
getAttr
<
ResizeAttr
::
NoROI
>()
&&
this
->
template
getAttr
<
ResizeAttr
::
NoSizes
>())
{
...
...
@@ -49,6 +56,11 @@ bool Aidge::Resize_Op::forwardDims(bool allowDataDependency) {
fmt::print("Condition scales: Input#0 and Input#2 must be provided and must have the same dimension,\
while Inputs#1 and #3 must not be provided.\n");
*/
if
(
!
allowDataDependency
)
{
Log
::
warn
(
"Resize_Op: unable to forwardDims() because output dims are data dependent\
on input#0 and input#2"
);
return
false
;
}
AIDGE_ASSERT
(
getInput
(
0
)
->
nbDims
()
==
getInput
(
2
)
->
size
(),
\
"input tensor and Scales must have the same dimensions."
);
...
...
@@ -73,6 +85,12 @@ bool Aidge::Resize_Op::forwardDims(bool allowDataDependency) {
while Inputs#1 and #2 must not be provided.\n");
*/
if
(
!
allowDataDependency
)
{
Log
::
warn
(
"Resize_Op: unable to forwardDims() because output dims are data dependent\
on input#0 and input#3)"
);
return
false
;
}
AIDGE_ASSERT
(
getInput
(
0
)
->
nbDims
()
==
getInput
(
3
)
->
size
(),
\
"input tensor and Sizes must have the same dimensions."
);
...
...
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