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
b0c72a83
Commit
b0c72a83
authored
Aug 25, 2017
by
Scott Cyphers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more doc.
parent
b527258d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
op.hpp
src/ngraph/op.hpp
+5
-2
op.cpp
src/ops/op.cpp
+8
-1
build_graph.cpp
test/build_graph.cpp
+1
-1
No files found.
src/ngraph/op.hpp
View file @
b0c72a83
...
...
@@ -36,7 +36,7 @@ namespace ngraph
/**
** Call nodes are nodes whose value is the result of some operation, the op,
** applied to its arguments. We use the op as a callable to construct the
** call nodes.
** call nodes.
For calls to user functions, the op will be the user function.
**/
class
Call
:
public
Node
{
...
...
@@ -56,7 +56,9 @@ namespace ngraph
};
/**
** There is exactly one instance of builtin op for each pre-defined operation.
** There is exactly one instance of builtin op for each pre-defined operation. These
** are intended to be used when matching calls in different graphs; every FooCall
** will have the same op.
**/
class
BuiltinOp
:
public
Op
{
...
...
@@ -124,6 +126,7 @@ namespace ngraph
class
DotCall
:
public
BuiltinCall
{
public
:
/// TODO: Semantics of arg0 and arg1 axes wrt reduction.
DotCall
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
)
:
BuiltinCall
(
s_op
,
{
arg0
,
arg1
})
{
...
...
src/ops/op.cpp
View file @
b0c72a83
...
...
@@ -19,7 +19,13 @@ using namespace std;
std
::
shared_ptr
<
BuiltinOp
>
BroadcastCall
::
s_op
=
make_shared
<
BuiltinOp
>
(
"broadcast"
);
shared_ptr
<
Node
>
ngraph
::
op
::
broadcast
(
const
Node
::
ptr
&
tensor
,
/**
** /param arg The tensor view to be broadcast.
** /param shape The shape of the result
** /param broadcast_axes The axis positions (0-based) in the result that are being broadcast.
** the remaining axes in shape must be the same as the shape of arg.
**/
shared_ptr
<
Node
>
ngraph
::
op
::
broadcast
(
const
Node
::
ptr
&
tensor
,
const
Shape
&
shape
,
const
vector
<
size_t
>&
broadcast_axes
)
{
...
...
@@ -28,6 +34,7 @@ shared_ptr<Node> ngraph::op::broadcast(const Node::ptr& tensor,
std
::
shared_ptr
<
BuiltinOp
>
DotCall
::
s_op
=
make_shared
<
BuiltinOp
>
(
"dot"
);
/// TODO: Semantics of arg0 and arg1 axes wrt reduction.
shared_ptr
<
Node
>
ngraph
::
op
::
dot
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
)
{
return
make_shared
<
DotCall
>
(
arg0
,
arg1
);
...
...
test/build_graph.cpp
View file @
b0c72a83
...
...
@@ -29,7 +29,7 @@ TEST(DISABLED_graph, build_simple)
cluster_0
->
parameter
(
2
)
->
type
(
element
::
float32_t
,
{
32
,
7
});
cluster_0
->
parameter
(
3
)
->
type
(
element
::
float32_t
,
{
32
,
7
});
auto
arg3
=
cluster_0
->
parameter
(
3
);
// call broadcast op on arg3, broadcasting on axis
1
.
// call broadcast op on arg3, broadcasting on axis
0
.
auto
broadcast_1
=
op
::
broadcast
(
arg3
,
{
10
,
32
,
7
},
{
0
});
auto
arg2
=
cluster_0
->
parameter
(
2
);
auto
arg0
=
cluster_0
->
parameter
(
0
);
...
...
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