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
ab4b984e
Commit
ab4b984e
authored
Sep 08, 2017
by
Adam Procter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates to comments; style fixes in dot.cpp
parent
2b2354e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
dot.hpp
src/ngraph/ops/dot.hpp
+4
-2
dot.cpp
src/ops/dot.cpp
+2
-2
No files found.
src/ngraph/ops/dot.hpp
View file @
ab4b984e
...
...
@@ -29,12 +29,14 @@ namespace ngraph
/// scalar-scalar product.
/// (Example: arg0 has shape {1,2,3} and arg1 has shape {}; then
/// the result will have shape {1,2,3}.)
///
/// (2) arg1 is 1-dimensional. Then, we compute a dot product reducing
/// on the innermost dimensions of arg0 and arg1.
/// on the innermost
(rightmost)
dimensions of arg0 and arg1.
/// (Example: arg0 has shape {1,2,3} and arg1 has shape {3}; then
/// the result will have shape {1,2}.)
///
/// (3) arg1 is more than 1-dimensional. Then, we compute a dot product
/// reducing on the innermost dimension of arg0, and the
/// reducing on the innermost
(rightmost)
dimension of arg0, and the
/// next-to-innermost dimension of arg1.
/// (Example: arg0 has shape {3,4} and arg1 has shape {4,3}; then
/// the result will have shape {3,3}.)
...
...
src/ops/dot.cpp
View file @
ab4b984e
...
...
@@ -38,7 +38,7 @@ void Dot::propagate_types()
vector
<
size_t
>
arg1_shape
=
arg1_tensor_type
->
get_shape
();
size_t
arg0_reduction
=
arg0_shape
.
size
()
-
1
;
size_t
arg1_reduction
;
bool
is_scalar_mult
=
arg0_shape
.
size
()
==
0
||
arg1_shape
.
size
()
==
0
;
const
bool
is_scalar_mult
=
arg0_shape
.
size
()
==
0
||
arg1_shape
.
size
()
==
0
;
if
(
arg1_shape
.
size
()
>
1
)
{
...
...
@@ -48,7 +48,7 @@ void Dot::propagate_types()
{
arg1_reduction
=
arg1_shape
.
size
()
-
1
;
}
if
(
!
is_scalar_mult
&&
arg0_shape
.
at
(
arg0_reduction
)
!=
arg1_shape
.
at
(
arg1_reduction
))
if
(
!
is_scalar_mult
&&
(
arg0_shape
.
at
(
arg0_reduction
)
!=
arg1_shape
.
at
(
arg1_reduction
)
))
{
throw
ngraph_error
(
"Dot reduction axes not compatible"
);
}
...
...
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