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
f73e0238
Commit
f73e0238
authored
Aug 31, 2017
by
Scott Cyphers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamings.
parent
c92cabf6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
21 deletions
+41
-21
op.hpp
src/ngraph/op.hpp
+8
-7
concatenate.hpp
src/ngraph/ops/concatenate.hpp
+2
-2
concatenate.cpp
src/ops/concatenate.cpp
+2
-2
op.cpp
src/ops/op.cpp
+4
-4
build_graph.cpp
test/build_graph.cpp
+25
-6
No files found.
src/ngraph/op.hpp
View file @
f73e0238
...
...
@@ -24,6 +24,7 @@ namespace ngraph
{
namespace
op
{
Node
::
ptr
abs
(
const
Node
::
ptr
&
arg
);
Node
::
ptr
add
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
Node
::
ptr
ceiling
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
...
...
@@ -31,7 +32,7 @@ namespace ngraph
//Node::ptr convolution();
Node
::
ptr
divide
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
Node
::
ptr
equal
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
Node
::
ptr
exp
onential
(
const
Node
::
ptr
&
arg0
);
Node
::
ptr
exp
(
const
Node
::
ptr
&
arg0
);
Node
::
ptr
floor
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
//Node::ptr get_tuple_element();
Node
::
ptr
greater
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
...
...
@@ -43,7 +44,7 @@ namespace ngraph
Node
::
ptr
maximum
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
Node
::
ptr
minimum
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
Node
::
ptr
multiply
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
Node
::
ptr
negate
(
const
Node
::
ptr
&
arg0
);
Node
::
ptr
negat
iv
e
(
const
Node
::
ptr
&
arg0
);
//Node::ptr pad();
Node
::
ptr
power
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
);
//Node::ptr reduce();
...
...
@@ -166,10 +167,10 @@ namespace ngraph
//virtual void propagate_types() override;
};
class
Exp
onential
Op
:
public
BuiltinOp
class
ExpOp
:
public
BuiltinOp
{
public
:
Exp
onential
Op
(
const
Node
::
ptr
&
arg0
)
ExpOp
(
const
Node
::
ptr
&
arg0
)
:
BuiltinOp
({
arg0
})
{
}
...
...
@@ -262,15 +263,15 @@ namespace ngraph
//virtual void propagate_types() override;
};
class
NegateOp
:
public
BuiltinOp
class
Negat
iv
eOp
:
public
BuiltinOp
{
public
:
NegateOp
(
const
Node
::
ptr
&
arg0
)
Negat
iv
eOp
(
const
Node
::
ptr
&
arg0
)
:
BuiltinOp
({
arg0
})
{
}
virtual
std
::
string
op_name
()
const
override
{
return
"negate"
;
}
virtual
std
::
string
op_name
()
const
override
{
return
"negat
iv
e"
;
}
//virtual void propagate_types() override;
};
...
...
src/ngraph/ops/concatenate.hpp
View file @
f73e0238
...
...
@@ -21,10 +21,10 @@ namespace ngraph
Node
::
ptr
concatenate
(
const
Nodes
&
args
);
}
class
Concat
enate
Op
:
public
BuiltinOp
class
ConcatOp
:
public
BuiltinOp
{
public
:
Concat
enate
Op
(
const
Nodes
&
args
)
ConcatOp
(
const
Nodes
&
args
)
:
BuiltinOp
(
args
)
{
}
...
...
src/ops/concatenate.cpp
View file @
f73e0238
...
...
@@ -19,12 +19,12 @@
using
namespace
std
;
using
namespace
ngraph
;
void
Concat
enate
Op
::
propagate_types
()
void
ConcatOp
::
propagate_types
()
{
throw
ngraph_error
(
"NIY"
);
}
Node
::
ptr
op
::
concatenate
(
const
std
::
vector
<
Node
::
ptr
>&
args
)
{
return
make_shared
<
Concat
enate
Op
>
(
args
);
return
make_shared
<
ConcatOp
>
(
args
);
}
src/ops/op.cpp
View file @
f73e0238
...
...
@@ -42,9 +42,9 @@ Node::ptr ngraph::op::divide(const Node::ptr& arg0, const Node::ptr& arg1)
return
make_shared
<
DivideOp
>
(
arg0
,
arg1
);
}
Node
::
ptr
ngraph
::
op
::
exp
onential
(
const
Node
::
ptr
&
arg0
)
Node
::
ptr
ngraph
::
op
::
exp
(
const
Node
::
ptr
&
arg0
)
{
return
make_shared
<
Exp
onential
Op
>
(
arg0
);
return
make_shared
<
ExpOp
>
(
arg0
);
}
Node
::
ptr
ngraph
::
op
::
floor
(
const
Node
::
ptr
&
arg0
,
const
Node
::
ptr
&
arg1
)
...
...
@@ -72,9 +72,9 @@ Node::ptr ngraph::op::multiply(const Node::ptr& arg0, const Node::ptr& arg1)
return
make_shared
<
MultiplyOp
>
(
arg0
,
arg1
);
}
Node
::
ptr
ngraph
::
op
::
negate
(
const
Node
::
ptr
&
arg0
)
Node
::
ptr
ngraph
::
op
::
negat
iv
e
(
const
Node
::
ptr
&
arg0
)
{
return
make_shared
<
NegateOp
>
(
arg0
);
return
make_shared
<
Negat
iv
eOp
>
(
arg0
);
}
// 'pad',
...
...
test/build_graph.cpp
View file @
f73e0238
...
...
@@ -16,18 +16,34 @@
#include "ngraph/ngraph.hpp"
#include <memory>
using
namespace
std
;
using
namespace
ngraph
;
template
<
typename
T
,
typename
...
A
>
std
::
shared_ptr
<
T
>
myfun
(
A
&&
...
args
)
{
return
std
::
make_shared
<
T
>
(
args
...);
}
template
<>
std
::
shared_ptr
<
Parameter
>
myfun
<
Parameter
>
(
ngraph
::
element
::
Type
&&
element_type
,
Shape
&&
shape
)
{
return
make_shared
<
Parameter
>
(
make_shared
<
TensorViewType
>
(
element_type
,
shape
));
}
TEST
(
build_graph
,
build_simple
)
{
// Function with 4 parameters
auto
arg0
=
op
::
parameter
(
element
::
Float
::
type
,
{
7
,
3
});
auto
arg1
=
op
::
parameter
(
element
::
Float
::
type
,
{
3
});
auto
arg2
=
op
::
parameter
(
element
::
Float
::
type
,
{
32
,
7
});
auto
arg3
=
op
::
parameter
(
element
::
Float
::
type
,
{
32
,
7
});
auto
broadcast_1
=
op
::
broadcast
(
arg3
,
{
10
,
32
,
7
},
{
0
});
auto
arg0
=
myfun
<
Parameter
>
(
element
::
Float
::
type
,
Shape
{
7
,
3
});
auto
arg1
=
op
::
parameter
(
element
::
Float
::
type
,
Shape
{
3
});
auto
arg2
=
op
::
parameter
(
element
::
Float
::
type
,
Shape
{
32
,
7
});
auto
arg3
=
op
::
parameter
(
element
::
Float
::
type
,
Shape
{
32
,
7
});
auto
broadcast_1
=
op
::
broadcast
(
arg3
,
Shape
{
10
,
32
,
7
},
BroadcastOp
::
Axes
{
0
});
auto
b1
=
myfun
<
BroadcastOp
>
(
arg3
,
Shape
{
10
,
32
,
7
},
BroadcastOp
::
Axes
{
0
});
auto
dot
=
op
::
dot
(
arg2
,
arg0
);
auto
d1
=
myfun
<
DotOp
>
(
arg2
,
arg0
);
ASSERT_EQ
(
dot
->
arguments
()[
0
],
arg2
);
ASSERT_EQ
(
dot
->
arguments
()[
1
],
arg0
);
...
...
@@ -96,4 +112,7 @@ TEST(build_graph, literal)
}
// Check argument inverses
TEST
(
build_graph
,
arg_inverse
)
{}
TEST
(
build_graph
,
arg_inverse
)
{
}
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