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
e985e98f
Unverified
Commit
e985e98f
authored
Feb 08, 2019
by
Robert Kimball
Committed by
GitHub
Feb 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into master
parents
ffcf2760
6beb6732
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
146 additions
and
1 deletion
+146
-1
CMakeLists.txt
src/ngraph/frontend/onnx_import/CMakeLists.txt
+2
-0
cosh.hpp
src/ngraph/frontend/onnx_import/op/cosh.hpp
+43
-0
sinh.hpp
src/ngraph/frontend/onnx_import/op/sinh.hpp
+43
-0
ops_bridge.cpp
src/ngraph/frontend/onnx_import/ops_bridge.cpp
+4
-0
ops_bridge.hpp
src/ngraph/frontend/onnx_import/ops_bridge.hpp
+2
-1
cosh.onnx
test/models/onnx/cosh.onnx
+13
-0
sinh.onnx
test/models/onnx/sinh.onnx
+13
-0
onnx_import.in.cpp
test/onnx_import.in.cpp
+26
-0
No files found.
src/ngraph/frontend/onnx_import/CMakeLists.txt
View file @
e985e98f
...
...
@@ -55,6 +55,7 @@ add_library(onnx_import STATIC
op/clip.cpp
op/clip.hpp
op/cos.hpp
op/cosh.hpp
op/concat.cpp
op/concat.hpp
op/constant.cpp
...
...
@@ -122,6 +123,7 @@ add_library(onnx_import STATIC
op/shape.cpp
op/sigmoid.hpp
op/sin.hpp
op/sinh.hpp
op/size.cpp
op/size.hpp
op/slice.cpp
...
...
src/ngraph/frontend/onnx_import/op/cosh.hpp
0 → 100644
View file @
e985e98f
//*****************************************************************************
// Copyright 2017-2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#pragma once
#include <memory>
#include "core/node.hpp"
#include "ngraph/node_vector.hpp"
#include "ngraph/op/cosh.hpp"
namespace
ngraph
{
namespace
onnx_import
{
namespace
op
{
namespace
set_1
{
inline
NodeVector
cosh
(
const
Node
&
node
)
{
return
{
std
::
make_shared
<
ngraph
::
op
::
Cosh
>
(
node
.
get_ng_inputs
().
at
(
0
))};
}
}
// namespace set_1
}
//namespace op
}
// namespace onnx_import
}
// namespace ngraph
src/ngraph/frontend/onnx_import/op/sinh.hpp
0 → 100644
View file @
e985e98f
//*****************************************************************************
// Copyright 2017-2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#pragma once
#include <memory>
#include "core/node.hpp"
#include "ngraph/node_vector.hpp"
#include "ngraph/op/sinh.hpp"
namespace
ngraph
{
namespace
onnx_import
{
namespace
op
{
namespace
set_1
{
inline
NodeVector
sinh
(
const
Node
&
node
)
{
return
{
std
::
make_shared
<
ngraph
::
op
::
Sinh
>
(
node
.
get_ng_inputs
().
at
(
0
))};
}
}
// namespace set_1
}
//namespace op
}
// namespace onnx_import
}
// namespace ngraph
src/ngraph/frontend/onnx_import/ops_bridge.cpp
View file @
e985e98f
...
...
@@ -40,6 +40,7 @@
#include "op/conv.hpp"
#include "op/conv_transpose.hpp"
#include "op/cos.hpp"
#include "op/cosh.hpp"
#include "op/depth_to_space.hpp"
#include "op/div.hpp"
#include "op/elu.hpp"
...
...
@@ -80,6 +81,7 @@
#include "op/shape.hpp"
#include "op/sigmoid.hpp"
#include "op/sin.hpp"
#include "op/sinh.hpp"
#include "op/size.hpp"
#include "op/slice.hpp"
#include "op/softmax.hpp"
...
...
@@ -219,6 +221,7 @@ namespace ngraph
REGISTER_OPERATOR
(
"Conv"
,
1
,
conv
);
REGISTER_OPERATOR
(
"ConvTranspose"
,
1
,
conv_transpose
);
REGISTER_OPERATOR
(
"Cos"
,
1
,
cos
);
REGISTER_OPERATOR
(
"Cosh"
,
1
,
cosh
);
REGISTER_OPERATOR
(
"DepthToSpace"
,
1
,
depth_to_space
);
REGISTER_OPERATOR
(
"Div"
,
1
,
div
);
REGISTER_OPERATOR
(
"Div"
,
7
,
div
);
...
...
@@ -273,6 +276,7 @@ namespace ngraph
REGISTER_OPERATOR
(
"Shape"
,
1
,
shape
);
REGISTER_OPERATOR
(
"Sigmoid"
,
1
,
sigmoid
);
REGISTER_OPERATOR
(
"Sin"
,
1
,
sin
);
REGISTER_OPERATOR
(
"Sinh"
,
1
,
sinh
);
REGISTER_OPERATOR
(
"Size"
,
1
,
size
);
REGISTER_OPERATOR
(
"Slice"
,
1
,
slice
);
REGISTER_OPERATOR
(
"Softmax"
,
1
,
softmax
);
...
...
src/ngraph/frontend/onnx_import/ops_bridge.hpp
View file @
e985e98f
...
...
@@ -51,7 +51,8 @@ namespace ngraph
UnsupportedVersion
(
const
std
::
string
&
name
,
std
::
int64_t
version
,
const
std
::
string
&
domain
)
:
ngraph_error
{(
domain
.
empty
()
?
""
:
domain
+
"."
)
+
name
+
":"
+
:
ngraph_error
{
"Unsupported operator version: "
+
(
domain
.
empty
()
?
""
:
domain
+
"."
)
+
name
+
":"
+
std
::
to_string
(
version
)}
{
}
...
...
test/models/onnx/cosh.onnx
0 → 100644
View file @
e985e98f
ngraph ONNXImporter:D
xy"Cosh
cosh_graphZ
x
b
y
B
\ No newline at end of file
test/models/onnx/sinh.onnx
0 → 100644
View file @
e985e98f
ngraph ONNXImporter:D
xy"Sinh
sinh_graphZ
x
b
y
B
\ No newline at end of file
test/onnx_import.in.cpp
View file @
e985e98f
...
...
@@ -1863,3 +1863,29 @@ TEST(onnx_${BACKEND_NAME}, model_top_k)
EXPECT_TRUE
(
test
::
all_close_f
(
expected_values_output
,
values_output
));
EXPECT_TRUE
(
test
::
all_close
(
expected_indices_output
,
indices_output
));
}
TEST
(
onnx_
$
{
BACKEND_NAME
},
model_sinh
)
{
auto
function
=
onnx_import
::
import_onnx_model
(
file_util
::
path_join
(
SERIALIZED_ZOO
,
"onnx/sinh.onnx"
));
Inputs
inputs
{
std
::
vector
<
float
>
{
-
1.0
f
,
0.0
f
,
1.0
f
}};
Outputs
expected_outputs
{
std
::
vector
<
float
>
{
-
1.1752012
f
,
0.
f
,
1.1752012
f
}};
Outputs
outputs
{
execute
(
function
,
inputs
,
"${BACKEND_NAME}"
)};
EXPECT_TRUE
(
test
::
all_close_f
(
expected_outputs
.
front
(),
outputs
.
front
()));
}
TEST
(
onnx_
$
{
BACKEND_NAME
},
model_cosh
)
{
auto
function
=
onnx_import
::
import_onnx_model
(
file_util
::
path_join
(
SERIALIZED_ZOO
,
"onnx/cosh.onnx"
));
Inputs
inputs
{
std
::
vector
<
float
>
{
-
1.0
f
,
0.0
f
,
1.0
f
}};
Outputs
expected_outputs
{
std
::
vector
<
float
>
{
1.54308069
f
,
1.
f
,
1.54308069
f
}};
Outputs
outputs
{
execute
(
function
,
inputs
,
"${BACKEND_NAME}"
)};
EXPECT_TRUE
(
test
::
all_close_f
(
expected_outputs
.
front
(),
outputs
.
front
()));
}
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