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
0344dca9
Commit
0344dca9
authored
7 years ago
by
Adam Procter
Committed by
GitHub
7 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #129 from NervanaSystems/cyphers/experiment
Simplify expression construction for tests.
parents
de672abe
8b1b4165
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
add.hpp
src/ngraph/ops/add.hpp
+6
-0
multiply.hpp
src/ngraph/ops/multiply.hpp
+6
-0
execute.cpp
test/execute.cpp
+2
-3
No files found.
src/ngraph/ops/add.hpp
View file @
0344dca9
...
...
@@ -28,4 +28,10 @@ namespace ngraph
virtual
std
::
string
description
()
const
override
{
return
"Add"
;
}
};
}
inline
std
::
shared_ptr
<
ngraph
::
Node
>
operator
+
(
const
std
::
shared_ptr
<
ngraph
::
Node
>
arg0
,
const
std
::
shared_ptr
<
ngraph
::
Node
>
arg1
)
{
return
std
::
make_shared
<
ngraph
::
op
::
Add
>
(
arg0
,
arg1
);
}
}
This diff is collapsed.
Click to expand it.
src/ngraph/ops/multiply.hpp
View file @
0344dca9
...
...
@@ -29,4 +29,10 @@ namespace ngraph
virtual
std
::
string
description
()
const
override
{
return
"Multiply"
;
}
};
}
inline
std
::
shared_ptr
<
ngraph
::
Node
>
operator
*
(
const
std
::
shared_ptr
<
ngraph
::
Node
>
arg0
,
const
std
::
shared_ptr
<
ngraph
::
Node
>
arg1
)
{
return
std
::
make_shared
<
ngraph
::
op
::
Multiply
>
(
arg0
,
arg1
);
}
}
This diff is collapsed.
Click to expand it.
test/execute.cpp
View file @
0344dca9
...
...
@@ -25,11 +25,10 @@ TEST(execute, test_abc)
auto
A
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape
);
auto
B
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape
);
auto
C
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape
);
auto
f
=
make_shared
<
Function
>
(
make_shared
<
op
::
Multiply
>
(
make_shared
<
op
::
Add
>
(
A
,
B
),
C
),
op
::
Parameters
{
A
,
B
,
C
});
auto
f
=
make_shared
<
Function
>
((
A
+
B
)
*
C
,
op
::
Parameters
{
A
,
B
,
C
});
auto
external
=
make_shared
<
ngraph
::
runtime
::
eigen
::
ExternalFunction
>
(
f
);
auto
cf
=
external
->
make_call_frame
();
auto
cf
=
external
->
make_call_frame
();
// Create some tensors for input/output
auto
a
=
make_shared
<
runtime
::
eigen
::
PrimaryTensorView
<
element
::
Float32
>>
(
shape
);
...
...
This diff is collapsed.
Click to expand it.
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