Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
5fa63dda
Commit
5fa63dda
authored
Oct 09, 2019
by
Chris Sullivan
Committed by
Sang Ik Lee
Oct 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Softmax::validate_and_infer_types (#3750)
parent
84b3bad1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
softmax.cpp
src/ngraph/op/softmax.cpp
+17
-8
softmax.hpp
src/ngraph/op/softmax.hpp
+4
-0
No files found.
src/ngraph/op/softmax.cpp
View file @
5fa63dda
...
...
@@ -53,14 +53,6 @@ op::v0::Softmax::Softmax(const Output<Node>& arg, const AxisSet& axes)
input_shape
,
")."
);
}
if
(
input_shape
.
is_static
())
{
set_output_type
(
0
,
get_input_element_type
(
0
),
input_shape
.
to_shape
());
}
else
{
set_output_type
(
0
,
get_input_element_type
(
0
),
PartialShape
::
dynamic
());
}
// empty axes == all axes
if
(
m_axes
.
size
()
==
0
)
...
...
@@ -72,6 +64,19 @@ op::v0::Softmax::Softmax(const Output<Node>& arg, const AxisSet& axes)
}
}
void
op
::
v0
::
Softmax
::
validate_and_infer_types
()
{
const
PartialShape
&
input_shape
=
get_input_partial_shape
(
0
);
if
(
input_shape
.
is_static
())
{
set_output_type
(
0
,
get_input_element_type
(
0
),
input_shape
.
to_shape
());
}
else
{
set_output_type
(
0
,
get_input_element_type
(
0
),
PartialShape
::
dynamic
());
}
}
shared_ptr
<
Node
>
op
::
v0
::
Softmax
::
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
{
check_new_args_count
(
this
,
new_args
);
...
...
@@ -128,7 +133,11 @@ op::v1::Softmax::Softmax(const Output<Node>& arg, const size_t axis)
") is out of bounds (argument shape: "
,
input_shape
,
")."
);
}
void
op
::
v1
::
Softmax
::
validate_and_infer_types
()
{
const
PartialShape
&
input_shape
=
get_input_partial_shape
(
0
);
if
(
input_shape
.
is_static
())
set_output_type
(
0
,
get_input_element_type
(
0
),
input_shape
.
to_shape
());
else
...
...
src/ngraph/op/softmax.hpp
View file @
5fa63dda
...
...
@@ -43,6 +43,8 @@ namespace ngraph
///
Softmax
(
const
Output
<
Node
>&
arg
,
const
AxisSet
&
axes
);
void
validate_and_infer_types
()
override
;
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
...
...
@@ -79,6 +81,8 @@ namespace ngraph
///
Softmax
(
const
Output
<
Node
>&
arg
,
const
size_t
axis
);
void
validate_and_infer_types
()
override
;
size_t
get_version
()
const
override
{
return
1
;
}
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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