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
c328e30f
Commit
c328e30f
authored
1 year ago
by
Houssem ROUIS
Committed by
Maxence Naud
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix clang warning
parent
a1ca1f8d
No related branches found
No related tags found
2 merge requests
!105
version 0.2.0
,
!65
[Add] broadcasting for Arithmetic Operators
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/operator/ArithmeticOperator.cpp
+5
-5
5 additions, 5 deletions
src/operator/ArithmeticOperator.cpp
with
5 additions
and
5 deletions
src/operator/ArithmeticOperator.cpp
+
5
−
5
View file @
c328e30f
...
...
@@ -21,7 +21,7 @@
void
Aidge
::
ArithmeticOperator
::
associateInput
(
const
Aidge
::
IOIndex_t
inputIdx
,
const
std
::
shared_ptr
<
Aidge
::
Data
>&
data
)
{
if
(
inputIdx
>=
2
)
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
%hu
inputs"
,
type
().
c_str
()
,
2
);
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
2
inputs"
,
type
().
c_str
());
}
if
(
strcmp
((
data
)
->
type
(),
Tensor
::
Type
)
!=
0
)
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"Input data must be of Tensor type"
);
...
...
@@ -55,7 +55,7 @@ void Aidge::ArithmeticOperator::setInput(const Aidge::IOIndex_t inputIdx, std::s
const
std
::
shared_ptr
<
Aidge
::
Tensor
>&
Aidge
::
ArithmeticOperator
::
getInput
(
const
Aidge
::
IOIndex_t
inputIdx
)
const
{
if
(
inputIdx
>=
nbInputs
())
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
%hu
inputs"
,
type
().
c_str
()
,
nbInputs
()
);
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
2
inputs"
,
type
().
c_str
());
}
return
mInputs
[
inputIdx
];
}
...
...
@@ -65,7 +65,7 @@ void Aidge::ArithmeticOperator::setOutput(const Aidge::IOIndex_t outputIdx, cons
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator only accepts Tensors as inputs"
,
type
().
c_str
());
}
if
(
outputIdx
>=
nbOutputs
())
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
%hu
outputs"
,
type
().
c_str
()
,
nbOutputs
()
);
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
1
outputs"
,
type
().
c_str
());
}
*
mOutputs
[
outputIdx
]
=
*
std
::
dynamic_pointer_cast
<
Tensor
>
(
data
);
}
...
...
@@ -75,14 +75,14 @@ void Aidge::ArithmeticOperator::setOutput(const Aidge::IOIndex_t outputIdx, std:
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator only accepts Tensors as inputs"
,
type
().
c_str
());
}
if
(
outputIdx
>=
nbOutputs
())
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
%hu
output
s
"
,
type
().
c_str
()
,
nbOutputs
()
);
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
1
output"
,
type
().
c_str
());
}
*
mOutputs
[
outputIdx
]
=
std
::
move
(
*
std
::
dynamic_pointer_cast
<
Tensor
>
(
data
));
}
const
std
::
shared_ptr
<
Aidge
::
Tensor
>&
Aidge
::
ArithmeticOperator
::
getOutput
(
const
Aidge
::
IOIndex_t
outputIdx
)
const
{
if
(
outputIdx
>=
nbOutputs
())
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
%hu
output
s
"
,
type
().
c_str
()
,
nbOutputs
()
);
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"%s Operator has
1
output"
,
type
().
c_str
());
}
return
mOutputs
[
outputIdx
];
}
...
...
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