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
71b6ef81
Commit
71b6ef81
authored
Nov 04, 2019
by
Tomasz Socha
Committed by
Scott Cyphers
Nov 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPEC] Rename element_type->destination_type attribute in Convert op (#3823)
parent
8ef5b0ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
convert.cpp
src/ngraph/op/convert.cpp
+4
-4
convert.hpp
src/ngraph/op/convert.hpp
+13
-7
No files found.
src/ngraph/op/convert.cpp
View file @
71b6ef81
...
...
@@ -23,22 +23,22 @@ using namespace ngraph;
constexpr
NodeTypeInfo
op
::
Convert
::
type_info
;
op
::
Convert
::
Convert
(
const
Output
<
Node
>&
arg
,
const
element
::
Type
&
element
_type
)
op
::
Convert
::
Convert
(
const
Output
<
Node
>&
arg
,
const
element
::
Type
&
destination
_type
)
:
Op
({
arg
})
,
m_
element_type
(
element
_type
)
,
m_
destination_type
(
destination
_type
)
{
constructor_validate_and_infer_types
();
}
void
op
::
Convert
::
validate_and_infer_types
()
{
set_output_type
(
0
,
m_
element
_type
,
get_input_partial_shape
(
0
));
set_output_type
(
0
,
m_
destination
_type
,
get_input_partial_shape
(
0
));
}
shared_ptr
<
Node
>
op
::
Convert
::
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
{
check_new_args_count
(
this
,
new_args
);
return
make_shared
<
Convert
>
(
new_args
.
at
(
0
),
m_
element
_type
);
return
make_shared
<
Convert
>
(
new_args
.
at
(
0
),
m_
destination
_type
);
}
void
op
::
Convert
::
generate_adjoints
(
autodiff
::
Adjoints
&
adjoints
,
const
NodeVector
&
deltas
)
...
...
src/ngraph/op/convert.hpp
View file @
71b6ef81
...
...
@@ -33,23 +33,29 @@ namespace ngraph
Convert
()
=
default
;
/// \brief Constructs a conversion operation.
///
/// \param arg Node that produces the input tensor.
/// \param
element_type
Element type for the output tensor.
Convert
(
const
Output
<
Node
>&
arg
,
const
ngraph
::
element
::
Type
&
element
_type
);
/// \param arg
Node that produces the input tensor.
/// \param
destination_type
Element type for the output tensor.
Convert
(
const
Output
<
Node
>&
arg
,
const
ngraph
::
element
::
Type
&
destination
_type
);
void
validate_and_infer_types
()
override
;
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
const
element
::
Type
&
get_
convert_element_type
()
const
{
return
m_element
_type
;
}
void
set_
convert_element_type
(
const
element
::
Type
&
element
_type
)
const
element
::
Type
&
get_
destination_type
()
const
{
return
m_destination
_type
;
}
void
set_
destination_type
(
const
element
::
Type
&
destination
_type
)
{
m_element_type
=
element_type
;
m_destination_type
=
destination_type
;
}
const
element
::
Type
&
get_convert_element_type
()
const
{
return
m_destination_type
;
}
void
set_convert_element_type
(
const
element
::
Type
&
destination_type
)
{
m_destination_type
=
destination_type
;
}
protected
:
ngraph
::
element
::
Type
m_
element
_type
;
ngraph
::
element
::
Type
m_
destination
_type
;
virtual
void
generate_adjoints
(
autodiff
::
Adjoints
&
adjoints
,
const
NodeVector
&
deltas
)
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