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
41f2884f
Unverified
Commit
41f2884f
authored
Aug 01, 2019
by
Scott Cyphers
Committed by
GitHub
Aug 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into aprocter/cf-reduction
parents
2249ad7c
52dce8bb
Hide whitespace changes
Inline
Side-by-side
Showing
131 changed files
with
392 additions
and
124 deletions
+392
-124
external_onnx.cmake
cmake/external_onnx.cmake
+6
-3
ngraph.ops.rst
doc/sphinx/source/python_api/_autosummary/ngraph.ops.rst
+1
-0
__init__.py
python/ngraph/__init__.py
+1
-0
__init__.py
python/ngraph/impl/op/__init__.py
+1
-0
ops.py
python/ngraph/ops.py
+19
-1
gelu.cpp
python/pyngraph/ops/fused/gelu.cpp
+30
-0
gelu.hpp
python/pyngraph/ops/fused/gelu.hpp
+23
-0
regmodule_pyngraph_op.cpp
python/pyngraph/ops/regmodule_pyngraph_op.cpp
+1
-0
regmodule_pyngraph_op.hpp
python/pyngraph/ops/regmodule_pyngraph_op.hpp
+1
-0
setup.py
python/setup.py
+1
-0
test_ops_fused.py
python/test/ngraph/test_ops_fused.py
+34
-1
attribute.hpp
src/ngraph/frontend/onnx_import/core/attribute.hpp
+1
-1
graph.hpp
src/ngraph/frontend/onnx_import/core/graph.hpp
+1
-1
model.cpp
src/ngraph/frontend/onnx_import/core/model.cpp
+1
-1
model.hpp
src/ngraph/frontend/onnx_import/core/model.hpp
+1
-1
node.cpp
src/ngraph/frontend/onnx_import/core/node.cpp
+1
-1
tensor.hpp
src/ngraph/frontend/onnx_import/core/tensor.hpp
+1
-1
value_info.hpp
src/ngraph/frontend/onnx_import/core/value_info.hpp
+1
-1
common.cpp
src/ngraph/frontend/onnx_import/utils/common.cpp
+1
-1
backend_manager.cpp
src/ngraph/frontend/onnxifi/backend_manager.cpp
+1
-1
backend_manager.hpp
src/ngraph/frontend/onnxifi/backend_manager.hpp
+1
-1
exceptions.hpp
src/ngraph/frontend/onnxifi/exceptions.hpp
+1
-1
onnxifi.cpp
src/ngraph/frontend/onnxifi/onnxifi.cpp
+1
-1
tensor.hpp
src/ngraph/frontend/onnxifi/tensor.hpp
+1
-1
avg_pool.hpp
src/ngraph/op/avg_pool.hpp
+1
-0
batch_norm.hpp
src/ngraph/op/batch_norm.hpp
+1
-0
batch_mat_mul.cpp
src/ngraph/op/experimental/batch_mat_mul.cpp
+3
-1
batch_mat_mul.hpp
src/ngraph/op/experimental/batch_mat_mul.hpp
+3
-0
compiled_kernel.cpp
src/ngraph/op/experimental/compiled_kernel.cpp
+3
-1
compiled_kernel.hpp
src/ngraph/op/experimental/compiled_kernel.hpp
+3
-0
dyn_broadcast.cpp
src/ngraph/op/experimental/dyn_broadcast.cpp
+3
-1
dyn_broadcast.hpp
src/ngraph/op/experimental/dyn_broadcast.hpp
+3
-0
dyn_pad.cpp
src/ngraph/op/experimental/dyn_pad.cpp
+3
-1
dyn_pad.hpp
src/ngraph/op/experimental/dyn_pad.hpp
+3
-0
dyn_replace_slice.cpp
src/ngraph/op/experimental/dyn_replace_slice.cpp
+3
-2
dyn_replace_slice.hpp
src/ngraph/op/experimental/dyn_replace_slice.hpp
+3
-0
dyn_reshape.cpp
src/ngraph/op/experimental/dyn_reshape.cpp
+3
-1
dyn_reshape.hpp
src/ngraph/op/experimental/dyn_reshape.hpp
+3
-0
dyn_slice.cpp
src/ngraph/op/experimental/dyn_slice.cpp
+3
-1
dyn_slice.hpp
src/ngraph/op/experimental/dyn_slice.hpp
+3
-0
ctc_greedy_decoder.cpp
src/ngraph/op/experimental/layers/ctc_greedy_decoder.cpp
+3
-1
ctc_greedy_decoder.hpp
src/ngraph/op/experimental/layers/ctc_greedy_decoder.hpp
+3
-0
detection_output.cpp
src/ngraph/op/experimental/layers/detection_output.cpp
+4
-3
detection_output.hpp
src/ngraph/op/experimental/layers/detection_output.hpp
+3
-0
interpolate.cpp
src/ngraph/op/experimental/layers/interpolate.cpp
+3
-1
interpolate.hpp
src/ngraph/op/experimental/layers/interpolate.hpp
+3
-0
prior_box.cpp
src/ngraph/op/experimental/layers/prior_box.cpp
+3
-1
prior_box.hpp
src/ngraph/op/experimental/layers/prior_box.hpp
+3
-0
prior_box_clustered.cpp
src/ngraph/op/experimental/layers/prior_box_clustered.cpp
+3
-1
prior_box_clustered.hpp
src/ngraph/op/experimental/layers/prior_box_clustered.hpp
+3
-0
proposal.cpp
src/ngraph/op/experimental/layers/proposal.cpp
+3
-1
proposal.hpp
src/ngraph/op/experimental/layers/proposal.hpp
+3
-0
psroi_pooling.cpp
src/ngraph/op/experimental/layers/psroi_pooling.cpp
+3
-1
psroi_pooling.hpp
src/ngraph/op/experimental/layers/psroi_pooling.hpp
+3
-0
region_yolo.cpp
src/ngraph/op/experimental/layers/region_yolo.cpp
+3
-1
region_yolo.hpp
src/ngraph/op/experimental/layers/region_yolo.hpp
+3
-0
reorg_yolo.cpp
src/ngraph/op/experimental/layers/reorg_yolo.cpp
+3
-1
reorg_yolo.hpp
src/ngraph/op/experimental/layers/reorg_yolo.hpp
+3
-0
roi_pooling.cpp
src/ngraph/op/experimental/layers/roi_pooling.cpp
+3
-1
roi_pooling.hpp
src/ngraph/op/experimental/layers/roi_pooling.hpp
+3
-0
quantized_concat.cpp
src/ngraph/op/experimental/quantized_concat.cpp
+3
-1
quantized_concat.hpp
src/ngraph/op/experimental/quantized_concat.hpp
+3
-0
shape_of.cpp
src/ngraph/op/experimental/shape_of.cpp
+3
-1
shape_of.hpp
src/ngraph/op/experimental/shape_of.hpp
+3
-0
tile.cpp
src/ngraph/op/experimental/tile.cpp
+3
-1
tile.hpp
src/ngraph/op/experimental/tile.hpp
+3
-0
transpose.cpp
src/ngraph/op/experimental/transpose.cpp
+3
-1
transpose.hpp
src/ngraph/op/experimental/transpose.hpp
+3
-0
pad.cpp
src/ngraph/op/pad.cpp
+3
-1
pad.hpp
src/ngraph/op/pad.hpp
+3
-0
parameter.cpp
src/ngraph/op/parameter.cpp
+3
-1
parameter.hpp
src/ngraph/op/parameter.hpp
+3
-0
passthrough.cpp
src/ngraph/op/passthrough.cpp
+7
-2
passthrough.hpp
src/ngraph/op/passthrough.hpp
+3
-0
power.cpp
src/ngraph/op/power.cpp
+3
-1
power.hpp
src/ngraph/op/power.hpp
+3
-0
relu.cpp
src/ngraph/op/relu.cpp
+5
-2
relu.hpp
src/ngraph/op/relu.hpp
+6
-0
reverse.cpp
src/ngraph/op/reverse.cpp
+3
-1
reverse.hpp
src/ngraph/op/reverse.hpp
+3
-0
reverse_sequence.cpp
src/ngraph/op/reverse_sequence.cpp
+3
-1
reverse_sequence.hpp
src/ngraph/op/reverse_sequence.hpp
+3
-0
scatter_add.cpp
src/ngraph/op/scatter_add.cpp
+2
-0
scatter_add.hpp
src/ngraph/op/scatter_add.hpp
+4
-1
scatter_nd_add.cpp
src/ngraph/op/scatter_nd_add.cpp
+2
-0
scatter_nd_add.hpp
src/ngraph/op/scatter_nd_add.hpp
+4
-1
sigmoid.cpp
src/ngraph/op/sigmoid.cpp
+5
-2
sigmoid.hpp
src/ngraph/op/sigmoid.hpp
+6
-0
sign.cpp
src/ngraph/op/sign.cpp
+3
-1
sign.hpp
src/ngraph/op/sign.hpp
+3
-0
sin.cpp
src/ngraph/op/sin.cpp
+3
-1
sin.hpp
src/ngraph/op/sin.hpp
+3
-0
sinh.cpp
src/ngraph/op/sinh.cpp
+3
-1
sinh.hpp
src/ngraph/op/sinh.hpp
+3
-0
softmax.cpp
src/ngraph/op/softmax.cpp
+3
-1
softmax.hpp
src/ngraph/op/softmax.hpp
+3
-0
sqrt.cpp
src/ngraph/op/sqrt.cpp
+3
-1
sqrt.hpp
src/ngraph/op/sqrt.hpp
+3
-0
stop_gradient.cpp
src/ngraph/op/stop_gradient.cpp
+3
-1
stop_gradient.hpp
src/ngraph/op/stop_gradient.hpp
+3
-0
tan.cpp
src/ngraph/op/tan.cpp
+3
-1
tan.hpp
src/ngraph/op/tan.hpp
+3
-0
tanh.cpp
src/ngraph/op/tanh.cpp
+3
-1
tanh.hpp
src/ngraph/op/tanh.hpp
+3
-0
batch_mat_mul_transpose.hpp
src/ngraph/runtime/cpu/op/batch_mat_mul_transpose.hpp
+0
-2
batch_norm_relu.hpp
src/ngraph/runtime/cpu/op/batch_norm_relu.hpp
+0
-2
bounded_relu.hpp
src/ngraph/runtime/cpu/op/bounded_relu.hpp
+0
-2
conv_add.hpp
src/ngraph/runtime/cpu/op/conv_add.hpp
+0
-2
conv_relu.hpp
src/ngraph/runtime/cpu/op/conv_relu.hpp
+0
-1
convert_layout.hpp
src/ngraph/runtime/cpu/op/convert_layout.hpp
+0
-1
deconv.hpp
src/ngraph/runtime/cpu/op/deconv.hpp
+0
-2
dropout.hpp
src/ngraph/runtime/cpu/op/dropout.hpp
+0
-2
group_conv_bias.hpp
src/ngraph/runtime/cpu/op/group_conv_bias.hpp
+0
-2
halide_op.hpp
src/ngraph/runtime/cpu/op/halide_op.hpp
+0
-2
leaky_relu.hpp
src/ngraph/runtime/cpu/op/leaky_relu.hpp
+0
-2
lstm.hpp
src/ngraph/runtime/cpu/op/lstm.hpp
+0
-2
matmul_bias.hpp
src/ngraph/runtime/cpu/op/matmul_bias.hpp
+0
-1
max_pool_with_indices.hpp
src/ngraph/runtime/cpu/op/max_pool_with_indices.hpp
+0
-2
quantized_matmul.hpp
src/ngraph/runtime/cpu/op/quantized_matmul.hpp
+0
-2
rnn.hpp
src/ngraph/runtime/cpu/op/rnn.hpp
+0
-1
sigmoid_mul.hpp
src/ngraph/runtime/cpu/op/sigmoid_mul.hpp
+0
-2
update_slice.hpp
src/ngraph/runtime/cpu/op/update_slice.hpp
+0
-2
plaidml_ops_convolution.hpp
src/ngraph/runtime/plaidml/plaidml_ops_convolution.hpp
+0
-3
plaidml_ops_implicit_broadcast.hpp
...ngraph/runtime/plaidml/plaidml_ops_implicit_broadcast.hpp
+0
-1
plaidml_ops_replicate.hpp
src/ngraph/runtime/plaidml/plaidml_ops_replicate.hpp
+0
-1
plaidml_ops_winograd.hpp
src/ngraph/runtime/plaidml/plaidml_ops_winograd.hpp
+0
-1
fused_op.in.cpp
test/backend/fused_op.in.cpp
+1
-2
onnx_import_rnn.in.cpp
test/onnx/onnx_import_rnn.in.cpp
+5
-10
onnxifi.cpp
test/onnx/onnxifi.cpp
+1
-1
test_case.cpp
test/util/test_case.cpp
+2
-7
test_case.hpp
test/util/test_case.hpp
+1
-3
No files found.
cmake/external_onnx.cmake
View file @
41f2884f
...
...
@@ -21,7 +21,7 @@ include(ExternalProject)
# ONNX.proto definition version
#------------------------------------------------------------------------------
set
(
ONNX_VERSION 1.
3
.0
)
set
(
ONNX_VERSION 1.
5
.0
)
#------------------------------------------------------------------------------
# Download and install libonnx ...
...
...
@@ -30,6 +30,9 @@ set(ONNX_VERSION 1.3.0)
set
(
ONNX_GIT_REPO_URL https://github.com/onnx/onnx.git
)
set
(
ONNX_GIT_BRANCH rel-
${
ONNX_VERSION
}
)
add_definitions
(
-DONNX_BUILD_SHARED_LIBS=ON
)
add_definitions
(
-DONNX_ML=ON
)
ExternalProject_Add
(
ext_onnx
PREFIX onnx
...
...
@@ -58,8 +61,8 @@ ExternalProject_Add(
ExternalProject_Get_Property
(
ext_onnx SOURCE_DIR BINARY_DIR
)
set
(
ONNX_INCLUDE_DIR
${
SOURCE_DIR
}
/onnx
)
set
(
ONNX_PROTO_INCLUDE_DIR
${
BINARY_DIR
}
/onnx
)
set
(
ONNX_INCLUDE_DIR
${
SOURCE_DIR
}
)
set
(
ONNX_PROTO_INCLUDE_DIR
${
BINARY_DIR
}
)
if
(
WIN32
)
set
(
ONNX_LIBRARY
${
BINARY_DIR
}
/
${
CMAKE_BUILD_TYPE
}
/onnx.lib
)
set
(
ONNX_PROTO_LIBRARY
${
BINARY_DIR
}
/
${
CMAKE_BUILD_TYPE
}
/onnx_proto.lib
)
...
...
doc/sphinx/source/python_api/_autosummary/ngraph.ops.rst
View file @
41f2884f
...
...
@@ -37,6 +37,7 @@ ngraph.ops
equal
exp
floor
gelu
get_output_element
greater
greater_eq
...
...
python/ngraph/__init__.py
View file @
41f2884f
...
...
@@ -50,6 +50,7 @@ from ngraph.ops import elu
from
ngraph.ops
import
equal
from
ngraph.ops
import
exp
from
ngraph.ops
import
floor
from
ngraph.ops
import
gelu
from
ngraph.ops
import
get_output_element
from
ngraph.ops
import
greater
from
ngraph.ops
import
greater_eq
...
...
python/ngraph/impl/op/__init__.py
View file @
41f2884f
...
...
@@ -74,6 +74,7 @@ from _pyngraph.op import Elu
from
_pyngraph.op
import
Equal
from
_pyngraph.op
import
Exp
from
_pyngraph.op
import
Floor
from
_pyngraph.op
import
Gelu
from
_pyngraph.op
import
GetOutputElement
from
_pyngraph.op
import
Greater
from
_pyngraph.op
import
GreaterEq
...
...
python/ngraph/ops.py
View file @
41f2884f
...
...
@@ -23,7 +23,7 @@ from ngraph.impl import AxisSet, AxisVector, Coordinate, CoordinateDiff, Functio
from
ngraph.impl.op
import
Abs
,
Acos
,
Add
,
And
,
Asin
,
ArgMax
,
ArgMin
,
Atan
,
AvgPool
,
\
BatchNormTraining
,
BatchNormInference
,
Broadcast
,
Ceiling
,
Clamp
,
Concat
,
Constant
,
Convert
,
\
Convolution
,
ConvolutionBackpropData
,
Cos
,
Cosh
,
Divide
,
Dot
,
Elu
,
Equal
,
Exp
,
Floor
,
\
GetOutputElement
,
Greater
,
GreaterEq
,
Less
,
LessEq
,
Log
,
LRN
,
Max
,
Maximum
,
MaxPool
,
\
Ge
lu
,
Ge
tOutputElement
,
Greater
,
GreaterEq
,
Less
,
LessEq
,
Log
,
LRN
,
Max
,
Maximum
,
MaxPool
,
\
Min
,
Minimum
,
Multiply
,
Negative
,
Not
,
NotEqual
,
OneHot
,
Or
,
Pad
,
Parameter
,
Product
,
\
Power
,
Relu
,
ReplaceSlice
,
Reshape
,
Reverse
,
Select
,
Sign
,
Sin
,
Sinh
,
Slice
,
Softmax
,
\
Sqrt
,
Subtract
,
Sum
,
Tan
,
Tanh
,
TopK
...
...
@@ -527,6 +527,24 @@ def convert(node, new_type, name=None): # type: (Node, NumericType, str) -> Nod
return
Convert
(
node
,
new_element_type
)
@nameable_op
def
gelu
(
node
,
name
=
None
):
# type: (NodeInput, str) -> Node
r"""Perform Gaussian Error Linear Unit operation element-wise on data from input node.
Computes GELU function:
.. math:: f(x) = 0.5\cdot x\cdot(1 + erf( \dfrac{x}{\sqrt{2}})
For more information refer to:
`Gaussian Error Linear Unit (GELU) <https://arxiv.org/pdf/1606.08415.pdf>`_
:param node: Input tensor. One of: input node, array or scalar.
:param name: Optional output node name.
:return: The new node performing a GELU operation on its input data element-wise.
"""
return
Gelu
(
as_node
(
node
))
@nameable_op
def
select
(
selection_node
,
input_node1
,
input_node2
,
name
=
None
):
# type: (Node, Node, Node, str) -> Node
...
...
python/pyngraph/ops/fused/gelu.cpp
0 → 100644
View file @
41f2884f
//*****************************************************************************
// 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.
//*****************************************************************************
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "ngraph/op/fused/gelu.hpp"
#include "pyngraph/ops/fused/gelu.hpp"
namespace
py
=
pybind11
;
void
regclass_pyngraph_op_Gelu
(
py
::
module
m
)
{
py
::
class_
<
ngraph
::
op
::
Gelu
,
std
::
shared_ptr
<
ngraph
::
op
::
Gelu
>
,
ngraph
::
op
::
Op
>
gelu
(
m
,
"Gelu"
);
gelu
.
doc
()
=
"ngraph.impl.op.Gelu wraps ngraph::op::Gelu"
;
gelu
.
def
(
py
::
init
<
const
std
::
shared_ptr
<
ngraph
::
Node
>&>
());
}
python/pyngraph/ops/fused/gelu.hpp
0 → 100644
View file @
41f2884f
//*****************************************************************************
// 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 <pybind11/pybind11.h>
namespace
py
=
pybind11
;
void
regclass_pyngraph_op_Gelu
(
py
::
module
m
);
python/pyngraph/ops/regmodule_pyngraph_op.cpp
View file @
41f2884f
...
...
@@ -54,6 +54,7 @@ void regmodule_pyngraph_op(py::module m_op)
regclass_pyngraph_op_Equal
(
m_op
);
regclass_pyngraph_op_Exp
(
m_op
);
regclass_pyngraph_op_Floor
(
m_op
);
regclass_pyngraph_op_Gelu
(
m_op
);
regclass_pyngraph_op_GetOutputElement
(
m_op
);
regclass_pyngraph_op_Greater
(
m_op
);
regclass_pyngraph_op_GreaterEq
(
m_op
);
...
...
python/pyngraph/ops/regmodule_pyngraph_op.hpp
View file @
41f2884f
...
...
@@ -44,6 +44,7 @@
#include "pyngraph/ops/floor.hpp"
#include "pyngraph/ops/fused/clamp.hpp"
#include "pyngraph/ops/fused/elu.hpp"
#include "pyngraph/ops/fused/gelu.hpp"
#include "pyngraph/ops/get_output_element.hpp"
#include "pyngraph/ops/greater.hpp"
#include "pyngraph/ops/greater_eq.hpp"
...
...
python/setup.py
View file @
41f2884f
...
...
@@ -184,6 +184,7 @@ sources = [
'pyngraph/ops/equal.cpp'
,
'pyngraph/ops/exp.cpp'
,
'pyngraph/ops/floor.cpp'
,
'pyngraph/ops/fused/gelu.cpp'
,
'pyngraph/ops/greater.cpp'
,
'pyngraph/ops/greater_eq.cpp'
,
'pyngraph/ops/less.cpp'
,
...
...
python/test/ngraph/test_ops_fused.py
View file @
41f2884f
...
...
@@ -19,7 +19,7 @@ import ngraph as ng
from
test.ngraph.util
import
get_runtime
def
test_elu_operator
():
def
test_elu_operator
_with_parameters
():
runtime
=
get_runtime
()
data_shape
=
[
2
,
2
]
...
...
@@ -69,6 +69,38 @@ def test_elu_operator_with_scalar():
assert
np
.
allclose
(
result
,
expected
)
def
test_gelu_operator_with_parameters
():
runtime
=
get_runtime
()
data_value
=
np
.
array
([[
-
5
,
1
],
[
-
2
,
3
]],
dtype
=
np
.
float32
)
data_shape
=
[
2
,
2
]
parameter_data
=
ng
.
parameter
(
data_shape
,
name
=
'Data'
,
dtype
=
np
.
float32
)
model
=
ng
.
gelu
(
parameter_data
)
computation
=
runtime
.
computation
(
model
,
parameter_data
)
result
=
computation
(
data_value
)
expected
=
np
.
array
([[
-
1.4901161e-06
,
8.4134471e-01
],
[
-
4.5500278e-02
,
2.9959502
]],
dtype
=
np
.
float32
)
assert
np
.
allclose
(
result
,
expected
)
def
test_gelu_operator_with_array
():
runtime
=
get_runtime
()
data_value
=
np
.
array
([[
-
5
,
1
],
[
-
2
,
3
]],
dtype
=
np
.
float32
)
model
=
ng
.
gelu
(
data_value
)
computation
=
runtime
.
computation
(
model
)
result
=
computation
()
expected
=
np
.
array
([[
-
1.4901161e-06
,
8.4134471e-01
],
[
-
4.5500278e-02
,
2.9959502
]],
dtype
=
np
.
float32
)
assert
np
.
allclose
(
result
,
expected
)
def
test_clamp_operator
():
runtime
=
get_runtime
()
...
...
@@ -99,4 +131,5 @@ def test_clamp_operator_with_array():
result
=
computation
()
expected
=
np
.
clip
(
data_value
,
min_value
,
max_value
)
assert
np
.
allclose
(
result
,
expected
)
src/ngraph/frontend/onnx_import/core/attribute.hpp
View file @
41f2884f
...
...
@@ -16,7 +16,7 @@
#pragma once
#include <onnx
-ml.
pb.h>
#include <onnx
/onnx_
pb.h>
#include "ngraph/except.hpp"
#include "tensor.hpp"
...
...
src/ngraph/frontend/onnx_import/core/graph.hpp
View file @
41f2884f
...
...
@@ -16,7 +16,7 @@
#pragma once
#include <onnx
-ml.
pb.h>
#include <onnx
/onnx_
pb.h>
#include <string>
#include <vector>
...
...
src/ngraph/frontend/onnx_import/core/model.cpp
View file @
41f2884f
...
...
@@ -14,7 +14,7 @@
// limitations under the License.
//*****************************************************************************
#include <onnx
-ml.
pb.h>
#include <onnx
/onnx_
pb.h>
#include "model.hpp"
#include "ngraph/log.hpp"
...
...
src/ngraph/frontend/onnx_import/core/model.hpp
View file @
41f2884f
...
...
@@ -16,7 +16,7 @@
#pragma once
#include <onnx
-ml.
pb.h>
#include <onnx
/onnx_
pb.h>
#include <ostream>
#include <string>
#include <unordered_map>
...
...
src/ngraph/frontend/onnx_import/core/node.cpp
View file @
41f2884f
...
...
@@ -14,7 +14,7 @@
// limitations under the License.
//*****************************************************************************
#include <onnx
-ml.
pb.h>
#include <onnx
/onnx_
pb.h>
#include "attribute.hpp"
#include "graph.hpp"
...
...
src/ngraph/frontend/onnx_import/core/tensor.hpp
View file @
41f2884f
...
...
@@ -16,7 +16,7 @@
#pragma once
#include <onnx
-ml.
pb.h>
#include <onnx
/onnx_
pb.h>
#include <utility>
#include <vector>
...
...
src/ngraph/frontend/onnx_import/core/value_info.hpp
View file @
41f2884f
...
...
@@ -16,7 +16,7 @@
#pragma once
#include <onnx
-ml.
pb.h>
#include <onnx
/onnx_
pb.h>
#include "ngraph/op/constant.hpp"
#include "ngraph/op/parameter.hpp"
...
...
src/ngraph/frontend/onnx_import/utils/common.cpp
View file @
41f2884f
...
...
@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#include <onnx
-ml.
pb.h> // onnx types
#include <onnx
/onnx_
pb.h> // onnx types
#include "common.hpp"
...
...
src/ngraph/frontend/onnxifi/backend_manager.cpp
View file @
41f2884f
...
...
@@ -15,7 +15,7 @@
//*****************************************************************************
#include <cstdlib> // std::size_t, std::uintptr_t
#include <onnxifi.h>
#include <onnx
/onnx
ifi.h>
#include <stdexcept> // std::invalid_agrument, std::out_of_rage
#include "backend.hpp"
...
...
src/ngraph/frontend/onnxifi/backend_manager.hpp
View file @
41f2884f
...
...
@@ -19,7 +19,7 @@
#include <cstddef> // std::size_t, std::uintptr_t
#include <map> // std::map
#include <mutex> // std::mutex
#include <onnxifi.h>
#include <onnx
/onnx
ifi.h>
#include "backend.hpp"
#include "ngraph/runtime/backend.hpp"
...
...
src/ngraph/frontend/onnxifi/exceptions.hpp
View file @
41f2884f
...
...
@@ -16,7 +16,7 @@
#pragma once
#include <onnxifi.h>
#include <onnx
/onnx
ifi.h>
namespace
ngraph
{
...
...
src/ngraph/frontend/onnxifi/onnxifi.cpp
View file @
41f2884f
...
...
@@ -16,7 +16,7 @@
#include <cstddef>
#include <cstdint>
#include <onnxifi.h>
#include <onnx
/onnx
ifi.h>
#include <stdexcept>
#include "backend_manager.hpp"
...
...
src/ngraph/frontend/onnxifi/tensor.hpp
View file @
41f2884f
...
...
@@ -17,7 +17,7 @@
#pragma once
#include <memory>
#include <onnxifi.h>
#include <onnx
/onnx
ifi.h>
#include "ngraph/runtime/backend.hpp"
#include "ngraph/runtime/tensor.hpp"
...
...
src/ngraph/op/avg_pool.hpp
View file @
41f2884f
...
...
@@ -173,6 +173,7 @@ namespace ngraph
class
AvgPoolBackprop
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
AvgPoolBackprop
()
=
default
;
...
...
src/ngraph/op/batch_norm.hpp
View file @
41f2884f
...
...
@@ -92,6 +92,7 @@ namespace ngraph
class
BatchNormInference
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
BatchNormInference
()
=
default
;
...
...
src/ngraph/op/experimental/batch_mat_mul.cpp
View file @
41f2884f
...
...
@@ -24,8 +24,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
BatchMatMul
::
type_name
{
"BatchMatMul"
};
op
::
BatchMatMul
::
BatchMatMul
(
const
shared_ptr
<
Node
>&
arg0
,
const
shared_ptr
<
Node
>&
arg1
)
:
Op
(
"BatchMatMul"
,
check_single_output_args
({
arg0
,
arg1
}))
:
Op
(
check_single_output_args
({
arg0
,
arg1
}))
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/experimental/batch_mat_mul.hpp
View file @
41f2884f
...
...
@@ -32,6 +32,9 @@ namespace ngraph
class
BatchMatMul
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a batch of matmul product operation.
///
/// \param arg0 The node producing the first argument.
...
...
src/ngraph/op/experimental/compiled_kernel.cpp
View file @
41f2884f
...
...
@@ -23,6 +23,8 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
CompiledKernel
::
type_name
{
"CompiledKernel"
};
shared_ptr
<
Node
>
ngraph
::
op
::
CompiledKernel
::
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
{
auto
args
=
inputs
();
...
...
@@ -64,7 +66,7 @@ shared_ptr<Node> ngraph::op::CompiledKernel::copy_with_new_args(const NodeVector
ngraph
::
op
::
CompiledKernel
::
CompiledKernel
(
const
NodeVector
&
node_list
,
const
NodeVector
&
outputs
,
const
NodeVector
&
args
)
:
Op
(
"CompiledKernel"
,
check_single_output_args
({
args
}))
:
Op
(
check_single_output_args
({
args
}))
,
m_node_list
(
node_list
)
,
m_output_nodes
(
outputs
)
{
...
...
src/ngraph/op/experimental/compiled_kernel.hpp
View file @
41f2884f
...
...
@@ -32,6 +32,9 @@ namespace ngraph
class
CompiledKernel
:
public
ngraph
::
op
::
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
CompiledKernel
(
const
NodeVector
&
node_list
,
const
NodeVector
&
outputs
,
const
NodeVector
&
args
);
...
...
src/ngraph/op/experimental/dyn_broadcast.cpp
View file @
41f2884f
...
...
@@ -20,10 +20,12 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
DynBroadcast
::
type_name
{
"DynBroadcast"
};
op
::
DynBroadcast
::
DynBroadcast
(
const
shared_ptr
<
Node
>&
arg
,
const
shared_ptr
<
Node
>&
shape
,
const
shared_ptr
<
Node
>&
broadcast_axes
)
:
Op
(
"DynBroadcast"
,
check_single_output_args
({
arg
,
shape
,
broadcast_axes
}))
:
Op
(
check_single_output_args
({
arg
,
shape
,
broadcast_axes
}))
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/experimental/dyn_broadcast.hpp
View file @
41f2884f
...
...
@@ -28,6 +28,9 @@ namespace ngraph
class
DynBroadcast
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a dynamic broadcast operation.
///
/// \param arg Node that produces the input tensor to be broadcast.
...
...
src/ngraph/op/experimental/dyn_pad.cpp
View file @
41f2884f
...
...
@@ -19,12 +19,14 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
DynPad
::
type_name
{
"DynPad"
};
op
::
DynPad
::
DynPad
(
const
std
::
shared_ptr
<
Node
>&
arg
,
const
std
::
shared_ptr
<
Node
>&
padding_below
,
const
std
::
shared_ptr
<
Node
>&
padding_above
,
const
std
::
shared_ptr
<
Node
>&
padding_value
,
op
::
PadMode
pad_mode
)
:
Op
(
"DynPad"
,
check_single_output_args
({
arg
,
padding_below
,
padding_above
,
padding_value
}))
:
Op
(
check_single_output_args
({
arg
,
padding_below
,
padding_above
,
padding_value
}))
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/experimental/dyn_pad.hpp
View file @
41f2884f
...
...
@@ -27,6 +27,9 @@ namespace ngraph
class
DynPad
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Perform dynamic padding of a tensor
///
/// \param arg The node producing input tensor to be padded.
...
...
src/ngraph/op/experimental/dyn_replace_slice.cpp
View file @
41f2884f
...
...
@@ -24,6 +24,8 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
DynReplaceSlice
::
type_name
{
"DynReplaceSlice"
};
op
::
DynReplaceSlice
::
DynReplaceSlice
(
const
shared_ptr
<
Node
>&
arg
,
const
shared_ptr
<
Node
>&
replacement
,
const
shared_ptr
<
Node
>&
lower_bounds
,
...
...
@@ -34,8 +36,7 @@ op::DynReplaceSlice::DynReplaceSlice(const shared_ptr<Node>& arg,
const
AxisSet
&
new_axis
,
const
AxisSet
&
shrink_axis
,
const
AxisSet
&
ellipsis_mask
)
:
Op
(
"DynReplaceSlice"
,
check_single_output_args
({
arg
,
replacement
,
lower_bounds
,
upper_bounds
,
strides
}))
:
Op
(
check_single_output_args
({
arg
,
replacement
,
lower_bounds
,
upper_bounds
,
strides
}))
,
m_lower_bounds_mask
(
lower_bounds_mask
)
,
m_upper_bounds_mask
(
upper_bounds_mask
)
,
m_new_axis
(
new_axis
)
...
...
src/ngraph/op/experimental/dyn_replace_slice.hpp
View file @
41f2884f
...
...
@@ -27,6 +27,9 @@ namespace ngraph
class
DynReplaceSlice
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a dynamic tensor replace-slice operation.
///
/// \param arg The tensor in which to replace the slice.
...
...
src/ngraph/op/experimental/dyn_reshape.cpp
View file @
41f2884f
...
...
@@ -24,10 +24,12 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
DynReshape
::
type_name
{
"DynReshape"
};
op
::
DynReshape
::
DynReshape
(
const
shared_ptr
<
Node
>&
arg
,
const
shared_ptr
<
Node
>&
pattern
,
bool
zero_flag
)
:
Op
(
"DynReshape"
,
check_single_output_args
({
arg
,
pattern
}))
:
Op
(
check_single_output_args
({
arg
,
pattern
}))
,
m_zero_flag
(
zero_flag
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/experimental/dyn_reshape.hpp
View file @
41f2884f
...
...
@@ -31,6 +31,9 @@ namespace ngraph
class
DynReshape
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a dynamic reshape operation. This operation does not perform transpose.
///
/// \param arg The tensor to be reshaped.
...
...
src/ngraph/op/experimental/dyn_slice.cpp
View file @
41f2884f
...
...
@@ -24,6 +24,8 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
DynSlice
::
type_name
{
"DynSlice"
};
op
::
DynSlice
::
DynSlice
(
const
shared_ptr
<
Node
>&
arg
,
const
shared_ptr
<
Node
>&
lower_bounds
,
const
shared_ptr
<
Node
>&
upper_bounds
,
...
...
@@ -33,7 +35,7 @@ op::DynSlice::DynSlice(const shared_ptr<Node>& arg,
const
AxisSet
&
new_axis
,
const
AxisSet
&
shrink_axis
,
const
AxisSet
&
ellipsis_mask
)
:
Op
(
"DynSlice"
,
check_single_output_args
({
arg
,
lower_bounds
,
upper_bounds
,
strides
}))
:
Op
(
check_single_output_args
({
arg
,
lower_bounds
,
upper_bounds
,
strides
}))
,
m_lower_bounds_mask
(
lower_bounds_mask
)
,
m_upper_bounds_mask
(
upper_bounds_mask
)
,
m_new_axis
(
new_axis
)
...
...
src/ngraph/op/experimental/dyn_slice.hpp
View file @
41f2884f
...
...
@@ -27,6 +27,9 @@ namespace ngraph
class
DynSlice
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a dynamic tensor slice operation.
///
/// \param arg The tensor to be sliced.
...
...
src/ngraph/op/experimental/layers/ctc_greedy_decoder.cpp
View file @
41f2884f
...
...
@@ -19,10 +19,12 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
CTCGreedyDecoder
::
type_name
{
"CTCGreedyDecoder"
};
op
::
CTCGreedyDecoder
::
CTCGreedyDecoder
(
const
shared_ptr
<
Node
>&
input
,
const
std
::
shared_ptr
<
Node
>&
seq_len
,
const
bool
ctc_merge_repeated
)
:
Op
(
"CTCGreedyDecoder"
,
check_single_output_args
({
input
,
seq_len
}))
:
Op
(
check_single_output_args
({
input
,
seq_len
}))
,
m_ctc_merge_repeated
(
ctc_merge_repeated
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/experimental/layers/ctc_greedy_decoder.hpp
View file @
41f2884f
...
...
@@ -25,6 +25,9 @@ namespace ngraph
class
CTCGreedyDecoder
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a CTCGreedyDecoder operation
///
/// \param input Logits on which greedy decoding is performed
...
...
src/ngraph/op/experimental/layers/detection_output.cpp
View file @
41f2884f
...
...
@@ -21,15 +21,16 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
DetectionOutput
::
type_name
{
"DetectionOutput"
};
op
::
DetectionOutput
::
DetectionOutput
(
const
std
::
shared_ptr
<
Node
>&
box_logits
,
const
std
::
shared_ptr
<
Node
>&
class_preds
,
const
std
::
shared_ptr
<
Node
>&
proposals
,
const
std
::
shared_ptr
<
Node
>&
aux_class_preds
,
const
std
::
shared_ptr
<
Node
>&
aux_box_preds
,
const
DetectionOutputAttrs
&
attrs
)
:
Op
(
"DetectionOutput"
,
check_single_output_args
(
{
box_logits
,
class_preds
,
proposals
,
aux_class_preds
,
aux_box_preds
}))
:
Op
(
check_single_output_args
(
{
box_logits
,
class_preds
,
proposals
,
aux_class_preds
,
aux_box_preds
}))
,
m_attrs
(
attrs
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/experimental/layers/detection_output.hpp
View file @
41f2884f
...
...
@@ -47,6 +47,9 @@ namespace ngraph
class
DetectionOutput
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a DetectionOutput operation
///
/// \param box_logits Box logits
...
...
src/ngraph/op/experimental/layers/interpolate.cpp
View file @
41f2884f
...
...
@@ -21,10 +21,12 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Interpolate
::
type_name
{
"Interpolate"
};
op
::
Interpolate
::
Interpolate
(
const
std
::
shared_ptr
<
Node
>&
image
,
const
std
::
shared_ptr
<
Node
>&
output_shape
,
const
InterpolateAttrs
&
attrs
)
:
Op
(
"Interpolate"
,
check_single_output_args
({
image
,
output_shape
}))
:
Op
(
check_single_output_args
({
image
,
output_shape
}))
,
m_attrs
(
attrs
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/experimental/layers/interpolate.hpp
View file @
41f2884f
...
...
@@ -36,6 +36,9 @@ namespace ngraph
class
Interpolate
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a Interpolate operation
///
/// \param image Input image
...
...
src/ngraph/op/experimental/layers/prior_box.cpp
View file @
41f2884f
...
...
@@ -21,10 +21,12 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
PriorBox
::
type_name
{
"PriorBox"
};
op
::
PriorBox
::
PriorBox
(
const
shared_ptr
<
Node
>&
layer_shape
,
const
shared_ptr
<
Node
>&
image_shape
,
const
PriorBoxAttrs
&
attrs
)
:
Op
(
"PriorBox"
,
check_single_output_args
({
layer_shape
,
image_shape
}))
:
Op
(
check_single_output_args
({
layer_shape
,
image_shape
}))
,
m_attrs
(
attrs
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/experimental/layers/prior_box.hpp
View file @
41f2884f
...
...
@@ -49,6 +49,9 @@ namespace ngraph
class
PriorBox
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a PriorBox operation
///
/// \param layer_shape Shape of layer for which prior boxes are computed
...
...
src/ngraph/op/experimental/layers/prior_box_clustered.cpp
View file @
41f2884f
...
...
@@ -21,10 +21,12 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
PriorBoxClustered
::
type_name
{
"PriorBoxClustered"
};
op
::
PriorBoxClustered
::
PriorBoxClustered
(
const
shared_ptr
<
Node
>&
layer_shape
,
const
shared_ptr
<
Node
>&
image_shape
,
const
PriorBoxClusteredAttrs
&
attrs
)
:
Op
(
"PriorBoxClustered"
,
check_single_output_args
({
layer_shape
,
image_shape
}))
:
Op
(
check_single_output_args
({
layer_shape
,
image_shape
}))
,
m_attrs
(
attrs
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/experimental/layers/prior_box_clustered.hpp
View file @
41f2884f
...
...
@@ -47,6 +47,9 @@ namespace ngraph
class
PriorBoxClustered
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a PriorBoxClustered operation
///
/// \param layer_shape Shape of layer for which prior boxes are computed
...
...
src/ngraph/op/experimental/layers/proposal.cpp
View file @
41f2884f
...
...
@@ -21,11 +21,13 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Proposal
::
type_name
{
"Proposal"
};
op
::
Proposal
::
Proposal
(
const
std
::
shared_ptr
<
Node
>&
class_probs
,
const
std
::
shared_ptr
<
Node
>&
class_logits
,
const
std
::
shared_ptr
<
Node
>&
image_shape
,
const
ProposalAttrs
&
attrs
)
:
Op
(
"Proposal"
,
check_single_output_args
({
class_probs
,
class_logits
,
image_shape
}))
:
Op
(
check_single_output_args
({
class_probs
,
class_logits
,
image_shape
}))
,
m_attrs
(
attrs
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/experimental/layers/proposal.hpp
View file @
41f2884f
...
...
@@ -57,6 +57,9 @@ namespace ngraph
class
Proposal
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a Proposal operation
///
/// \param class_probs Class probability scores
...
...
src/ngraph/op/experimental/layers/psroi_pooling.cpp
View file @
41f2884f
...
...
@@ -19,6 +19,8 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
PSROIPooling
::
type_name
{
"PSROIPooling"
};
op
::
PSROIPooling
::
PSROIPooling
(
const
shared_ptr
<
Node
>&
input
,
const
std
::
shared_ptr
<
Node
>&
coords
,
const
size_t
output_dim
,
...
...
@@ -26,7 +28,7 @@ op::PSROIPooling::PSROIPooling(const shared_ptr<Node>& input,
const
float
spatial_scale
,
const
Shape
&
num_bins
,
const
std
::
string
&
kind
)
:
Op
(
"PSROIPooling"
,
check_single_output_args
({
input
,
coords
}))
:
Op
(
check_single_output_args
({
input
,
coords
}))
,
m_output_dim
(
output_dim
)
,
m_group_size
(
group_size
)
,
m_spatial_scale
(
spatial_scale
)
...
...
src/ngraph/op/experimental/layers/psroi_pooling.hpp
View file @
41f2884f
...
...
@@ -25,6 +25,9 @@ namespace ngraph
class
PSROIPooling
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a PSROIPooling operation
///
/// \param input Input feature map {N, C, ...}
...
...
src/ngraph/op/experimental/layers/region_yolo.cpp
View file @
41f2884f
...
...
@@ -19,6 +19,8 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
RegionYolo
::
type_name
{
"RegionYolo"
};
op
::
RegionYolo
::
RegionYolo
(
const
shared_ptr
<
Node
>&
input
,
const
size_t
num_coords
,
const
size_t
num_classes
,
...
...
@@ -27,7 +29,7 @@ op::RegionYolo::RegionYolo(const shared_ptr<Node>& input,
const
vector
<
int64_t
>&
mask
,
const
int
axis
,
const
int
end_axis
)
:
Op
(
"RegionYolo"
,
check_single_output_args
({
input
}))
:
Op
(
check_single_output_args
({
input
}))
,
m_num_coords
(
num_coords
)
,
m_num_classes
(
num_classes
)
,
m_num_regions
(
num_regions
)
...
...
src/ngraph/op/experimental/layers/region_yolo.hpp
View file @
41f2884f
...
...
@@ -25,6 +25,9 @@ namespace ngraph
class
RegionYolo
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a RegionYolo operation
///
/// \param input Input
...
...
src/ngraph/op/experimental/layers/reorg_yolo.cpp
View file @
41f2884f
...
...
@@ -21,8 +21,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
ReorgYolo
::
type_name
{
"ReorgYolo"
};
op
::
ReorgYolo
::
ReorgYolo
(
const
shared_ptr
<
Node
>&
input
,
const
Strides
&
strides
)
:
Op
(
"ReorgYolo"
,
check_single_output_args
({
input
}))
:
Op
(
check_single_output_args
({
input
}))
,
m_strides
(
strides
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/experimental/layers/reorg_yolo.hpp
View file @
41f2884f
...
...
@@ -25,6 +25,9 @@ namespace ngraph
class
ReorgYolo
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a ReorgYolo operation
///
/// \param input Input
...
...
src/ngraph/op/experimental/layers/roi_pooling.cpp
View file @
41f2884f
...
...
@@ -19,12 +19,14 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
ROIPooling
::
type_name
{
"ROIPooling"
};
op
::
ROIPooling
::
ROIPooling
(
const
shared_ptr
<
Node
>&
input
,
const
std
::
shared_ptr
<
Node
>&
coords
,
const
Shape
&
output_size
,
const
float
spatial_scale
,
const
std
::
string
&
kind
)
:
Op
(
"ROIPooling"
,
check_single_output_args
({
input
,
coords
}))
:
Op
(
check_single_output_args
({
input
,
coords
}))
,
m_output_size
(
output_size
)
,
m_spatial_scale
(
spatial_scale
)
,
m_kind
(
kind
)
...
...
src/ngraph/op/experimental/layers/roi_pooling.hpp
View file @
41f2884f
...
...
@@ -25,6 +25,9 @@ namespace ngraph
class
ROIPooling
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a ROIPooling operation
///
/// \param input Input feature map {N, C, ...}
...
...
src/ngraph/op/experimental/quantized_concat.cpp
View file @
41f2884f
...
...
@@ -23,8 +23,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
QuantizedConcat
::
type_name
{
"QuantizedConcat"
};
op
::
QuantizedConcat
::
QuantizedConcat
(
const
NodeVector
&
args
,
size_t
concatenation_axis
)
:
Op
(
"QuantizedConcat"
,
check_single_output_args
(
args
))
:
Op
(
check_single_output_args
(
args
))
,
m_concatenation_axis
(
concatenation_axis
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/experimental/quantized_concat.hpp
View file @
41f2884f
...
...
@@ -28,6 +28,9 @@ namespace ngraph
class
QuantizedConcat
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a concatenation operation.
///
/// \param args The nodes producing the input tensors.
...
...
src/ngraph/op/experimental/shape_of.cpp
View file @
41f2884f
...
...
@@ -20,8 +20,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
ShapeOf
::
type_name
{
"ShapeOf"
};
op
::
ShapeOf
::
ShapeOf
(
const
shared_ptr
<
Node
>&
arg
)
:
Op
(
"ShapeOf"
,
check_single_output_args
({
arg
}))
:
Op
(
check_single_output_args
({
arg
}))
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/experimental/shape_of.hpp
View file @
41f2884f
...
...
@@ -26,6 +26,9 @@ namespace ngraph
class
ShapeOf
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a shape-of operation.
ShapeOf
(
const
std
::
shared_ptr
<
Node
>&
arg
);
...
...
src/ngraph/op/experimental/tile.cpp
View file @
41f2884f
...
...
@@ -21,8 +21,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Tile
::
type_name
{
"Tile"
};
op
::
Tile
::
Tile
(
const
std
::
shared_ptr
<
Node
>&
arg
,
const
std
::
shared_ptr
<
Node
>&
repeats
)
:
Op
(
"Tile"
,
check_single_output_args
({
arg
,
repeats
}))
:
Op
(
check_single_output_args
({
arg
,
repeats
}))
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/experimental/tile.hpp
View file @
41f2884f
...
...
@@ -27,6 +27,9 @@ namespace ngraph
class
Tile
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Perform dynamic padding of a tensor
///
/// \param arg The node producing input tensor to be padded.
...
...
src/ngraph/op/experimental/transpose.cpp
View file @
41f2884f
...
...
@@ -22,8 +22,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Transpose
::
type_name
{
"Transpose"
};
op
::
Transpose
::
Transpose
(
const
shared_ptr
<
Node
>&
arg
,
const
shared_ptr
<
Node
>&
input_order
)
:
Op
(
"Transpose"
,
check_single_output_args
({
arg
,
input_order
}))
:
Op
(
check_single_output_args
({
arg
,
input_order
}))
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/experimental/transpose.hpp
View file @
41f2884f
...
...
@@ -28,6 +28,9 @@ namespace ngraph
class
Transpose
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a transpose operation.
///
/// \param arg Node producing the tensor to be transposed.
...
...
src/ngraph/op/pad.cpp
View file @
41f2884f
...
...
@@ -21,12 +21,14 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Pad
::
type_name
{
"Pad"
};
op
::
Pad
::
Pad
(
const
shared_ptr
<
Node
>&
arg
,
const
shared_ptr
<
Node
>&
arg_pad_value
,
const
CoordinateDiff
&
padding_below
,
const
CoordinateDiff
&
padding_above
,
PadMode
pad_mode
)
:
Op
(
"Pad"
,
check_single_output_args
({
arg
,
arg_pad_value
}))
:
Op
(
check_single_output_args
({
arg
,
arg_pad_value
}))
,
m_padding_below
(
padding_below
)
,
m_padding_above
(
padding_above
)
,
m_padding_interior_fake
(
padding_below
.
size
())
...
...
src/ngraph/op/pad.hpp
View file @
41f2884f
...
...
@@ -28,6 +28,9 @@ namespace ngraph
class
Pad
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a generic padding operation.
///
/// \param arg The node producing input tensor to be padded.
...
...
src/ngraph/op/parameter.cpp
View file @
41f2884f
...
...
@@ -21,10 +21,12 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Parameter
::
type_name
{
"Parameter"
};
op
::
Parameter
::
Parameter
(
const
element
::
Type
&
element_type
,
const
PartialShape
&
pshape
,
const
bool
cacheable
)
:
Op
(
"Parameter"
,
{})
:
Op
(
NodeVector
{})
,
m_cacheable
(
cacheable
)
,
m_partial_shape
(
pshape
)
,
m_element_type
(
element_type
)
...
...
src/ngraph/op/parameter.hpp
View file @
41f2884f
...
...
@@ -35,6 +35,9 @@ namespace ngraph
const
NodeVector
&
deltas
)
override
;
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructions a tensor-typed parameter node.
///
/// \param element_type The element type of the parameter.
...
...
src/ngraph/op/passthrough.cpp
View file @
41f2884f
...
...
@@ -18,12 +18,17 @@
#include "ngraph/op/passthrough.hpp"
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Passthrough
::
type_name
{
"Passthrough"
};
ngraph
::
op
::
Passthrough
::
Passthrough
(
const
std
::
string
&
logical_type
,
const
std
::
string
&
language
,
const
std
::
string
&
function
,
const
NodeVector
&
args
,
std
::
vector
<
std
::
tuple
<
element
::
Type
,
PartialShape
>>
outputs
)
:
Op
{
"Passthrough"
,
args
}
:
Op
{
args
}
,
m_logical_type
{
logical_type
}
,
m_language
{
language
}
,
m_function
{
function
}
...
...
@@ -65,5 +70,5 @@ std::shared_ptr<ngraph::Node>
"Passthrough node input counts cannot be changed for a given Passthrough function"
};
}
return
std
::
make_shared
<
Passthrough
>
(
description
()
,
m_language
,
m_function
,
new_args
,
m_output_shapes
);
m_logical_type
,
m_language
,
m_function
,
new_args
,
m_output_shapes
);
}
src/ngraph/op/passthrough.hpp
View file @
41f2884f
...
...
@@ -38,6 +38,9 @@ namespace ngraph
class
ngraph
::
op
::
Passthrough
final
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
Passthrough
(
const
std
::
string
&
logical_type
,
// aka "What this operation is doing"
const
std
::
string
&
language
,
// The language the implementation is written in
const
std
::
string
&
function
,
// The operation implementation
...
...
src/ngraph/op/power.cpp
View file @
41f2884f
...
...
@@ -22,10 +22,12 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Power
::
type_name
{
"Power"
};
op
::
Power
::
Power
(
const
shared_ptr
<
Node
>&
arg0
,
const
shared_ptr
<
Node
>&
arg1
,
const
AutoBroadcastSpec
&
autob
)
:
BinaryElementwiseArithmetic
(
"Power"
,
arg0
,
arg1
,
autob
)
:
BinaryElementwiseArithmetic
(
arg0
,
arg1
,
autob
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/power.hpp
View file @
41f2884f
...
...
@@ -39,6 +39,9 @@ namespace ngraph
class
Power
:
public
util
::
BinaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs an exponentiation operation.
///
/// \param arg0 Node that produces the first input tensor.
...
...
src/ngraph/op/relu.cpp
View file @
41f2884f
...
...
@@ -20,8 +20,11 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Relu
::
type_name
{
"Relu"
};
const
string
op
::
ReluBackprop
::
type_name
{
"ReluBackprop"
};
op
::
Relu
::
Relu
(
shared_ptr
<
Node
>
arg
)
:
UnaryElementwiseArithmetic
(
"Relu"
,
{
arg
}
)
:
UnaryElementwiseArithmetic
(
arg
)
{
constructor_validate_and_infer_types
();
}
...
...
@@ -33,7 +36,7 @@ shared_ptr<Node> op::Relu::copy_with_new_args(const NodeVector& new_args) const
}
op
::
ReluBackprop
::
ReluBackprop
(
shared_ptr
<
Node
>
arg
,
shared_ptr
<
Node
>
delta
)
:
BinaryElementwiseArithmetic
(
"ReluBackprop"
,
arg
,
delta
)
:
BinaryElementwiseArithmetic
(
arg
,
delta
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/relu.hpp
View file @
41f2884f
...
...
@@ -33,6 +33,9 @@ namespace ngraph
class
Relu
:
public
ngraph
::
op
::
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a Relu operation.
///
/// \param arg Node that produces the input tensor.
...
...
@@ -50,6 +53,9 @@ namespace ngraph
class
ReluBackprop
:
public
ngraph
::
op
::
util
::
BinaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a ReluBackprop operation.
///
/// \param arg Node that produces the relu forward input tensor.
...
...
src/ngraph/op/reverse.cpp
View file @
41f2884f
...
...
@@ -23,8 +23,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Reverse
::
type_name
{
"Reverse"
};
op
::
Reverse
::
Reverse
(
const
shared_ptr
<
Node
>&
arg
,
const
AxisSet
&
reversed_axes
)
:
Op
(
"Reverse"
,
check_single_output_args
({
arg
}))
:
Op
(
check_single_output_args
({
arg
}))
,
m_reversed_axes
(
reversed_axes
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/reverse.hpp
View file @
41f2884f
...
...
@@ -46,6 +46,9 @@ namespace ngraph
class
Reverse
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a reverse operation.
///
/// \param arg The input tensor, some of whose axes are to be reversed.
...
...
src/ngraph/op/reverse_sequence.cpp
View file @
41f2884f
...
...
@@ -25,11 +25,13 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
ReverseSequence
::
type_name
{
"ReverseSequence"
};
op
::
ReverseSequence
::
ReverseSequence
(
const
std
::
shared_ptr
<
Node
>
arg
,
const
std
::
shared_ptr
<
Node
>
seq_indices
,
size_t
batch_axis
,
size_t
seq_axis
)
:
Op
(
"ReverseSequence"
,
check_single_output_args
({
arg
,
seq_indices
}))
:
Op
(
check_single_output_args
({
arg
,
seq_indices
}))
,
m_batch_axis
(
batch_axis
)
,
m_seq_axis
(
seq_axis
)
{
...
...
src/ngraph/op/reverse_sequence.hpp
View file @
41f2884f
...
...
@@ -25,6 +25,9 @@ namespace ngraph
class
ReverseSequence
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs an arcsin operation.
///
/// \param arg Node that produces the input tensor.
...
...
src/ngraph/op/scatter_add.cpp
View file @
41f2884f
...
...
@@ -24,6 +24,8 @@ static int INPUTS = 0;
static
int
INDICES
=
1
;
static
int
UPDATES
=
2
;
const
string
op
::
ScatterAdd
::
type_name
{
"ScatterAdd"
};
shared_ptr
<
Node
>
op
::
ScatterAdd
::
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
{
check_new_args_count
(
this
,
new_args
);
...
...
src/ngraph/op/scatter_add.hpp
View file @
41f2884f
...
...
@@ -26,13 +26,16 @@ namespace ngraph
class
ScatterAdd
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \param inputs Tensor
/// \param indices Index tensor: Data type must be `element::i32` or `element::i64`
/// \param updates Tensor: Must have same type as inputs
ScatterAdd
(
const
std
::
shared_ptr
<
Node
>&
inputs
,
const
std
::
shared_ptr
<
Node
>&
indices
,
const
std
::
shared_ptr
<
Node
>&
updates
)
:
Op
(
"ScatterAdd"
,
check_single_output_args
({
inputs
,
indices
,
updates
}))
:
Op
(
check_single_output_args
({
inputs
,
indices
,
updates
}))
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/scatter_nd_add.cpp
View file @
41f2884f
...
...
@@ -24,6 +24,8 @@ static int INPUTS = 0;
static
int
INDICES
=
1
;
static
int
UPDATES
=
2
;
const
string
op
::
ScatterNDAdd
::
type_name
{
"ScatterNDAdd"
};
shared_ptr
<
Node
>
op
::
ScatterNDAdd
::
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
{
check_new_args_count
(
this
,
new_args
);
...
...
src/ngraph/op/scatter_nd_add.hpp
View file @
41f2884f
...
...
@@ -26,13 +26,16 @@ namespace ngraph
class
ScatterNDAdd
:
public
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \param inputs Tensor
/// \param indices Index tensor: Data type must be `element::i32` or `element::i64`
/// \param updates Tensor: Must have same type as inputs
ScatterNDAdd
(
const
std
::
shared_ptr
<
Node
>&
inputs
,
const
std
::
shared_ptr
<
Node
>&
indices
,
const
std
::
shared_ptr
<
Node
>&
updates
)
:
Op
(
"ScatterNDAdd"
,
check_single_output_args
({
inputs
,
indices
,
updates
}))
:
Op
(
check_single_output_args
({
inputs
,
indices
,
updates
}))
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/sigmoid.cpp
View file @
41f2884f
...
...
@@ -21,6 +21,9 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Sigmoid
::
type_name
{
"Sigmoid"
};
const
string
op
::
SigmoidBackprop
::
type_name
{
"SigmoidBackprop"
};
shared_ptr
<
Node
>
op
::
Sigmoid
::
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
{
check_new_args_count
(
this
,
new_args
);
...
...
@@ -28,13 +31,13 @@ shared_ptr<Node> op::Sigmoid::copy_with_new_args(const NodeVector& new_args) con
}
op
::
Sigmoid
::
Sigmoid
(
shared_ptr
<
Node
>
arg
)
:
UnaryElementwiseArithmetic
(
"Sigmoid"
,
arg
)
:
UnaryElementwiseArithmetic
(
arg
)
{
constructor_validate_and_infer_types
();
}
op
::
SigmoidBackprop
::
SigmoidBackprop
(
shared_ptr
<
Node
>
arg
,
shared_ptr
<
Node
>
delta
)
:
BinaryElementwiseArithmetic
(
"SigmoidBackprop"
,
arg
,
delta
)
:
BinaryElementwiseArithmetic
(
arg
,
delta
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/sigmoid.hpp
View file @
41f2884f
...
...
@@ -28,6 +28,9 @@ namespace ngraph
class
Sigmoid
:
public
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
Sigmoid
(
std
::
shared_ptr
<
Node
>
arg
);
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
...
...
@@ -40,6 +43,9 @@ namespace ngraph
class
SigmoidBackprop
:
public
util
::
BinaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a SigmoidBackprop operation.
///
/// \param arg Node that produces the Sigmoid forward input tensor.
...
...
src/ngraph/op/sign.cpp
View file @
41f2884f
...
...
@@ -19,8 +19,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Sign
::
type_name
{
"Sign"
};
op
::
Sign
::
Sign
(
const
shared_ptr
<
Node
>&
arg
)
:
UnaryElementwiseArithmetic
(
"Sign"
,
arg
)
:
UnaryElementwiseArithmetic
(
arg
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/sign.hpp
View file @
41f2884f
...
...
@@ -27,6 +27,9 @@ namespace ngraph
class
Sign
:
public
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs an elementwise sign operation.
///
/// \param arg Node that produces the input tensor.
...
...
src/ngraph/op/sin.cpp
View file @
41f2884f
...
...
@@ -21,8 +21,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Sin
::
type_name
{
"Sin"
};
op
::
Sin
::
Sin
(
const
shared_ptr
<
Node
>&
arg
)
:
UnaryElementwiseArithmetic
(
"Sin"
,
arg
)
:
UnaryElementwiseArithmetic
(
arg
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/sin.hpp
View file @
41f2884f
...
...
@@ -38,6 +38,9 @@ namespace ngraph
class
Sin
:
public
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a sine operation.
///
/// \param arg Node that produces the input tensor.
...
...
src/ngraph/op/sinh.cpp
View file @
41f2884f
...
...
@@ -21,8 +21,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Sinh
::
type_name
{
"Sinh"
};
op
::
Sinh
::
Sinh
(
const
shared_ptr
<
Node
>&
arg
)
:
UnaryElementwiseArithmetic
(
"Sinh"
,
arg
)
:
UnaryElementwiseArithmetic
(
arg
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/sinh.hpp
View file @
41f2884f
...
...
@@ -26,6 +26,9 @@ namespace ngraph
class
Sinh
:
public
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a hyperbolic sine operation.
///
/// \param arg Node that produces the input tensor.
...
...
src/ngraph/op/softmax.cpp
View file @
41f2884f
...
...
@@ -29,8 +29,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Softmax
::
type_name
{
"Softmax"
};
op
::
Softmax
::
Softmax
(
const
shared_ptr
<
Node
>&
arg
,
const
AxisSet
&
axes
)
:
UnaryElementwiseArithmetic
(
"Softmax"
,
arg
)
:
UnaryElementwiseArithmetic
(
arg
)
,
m_axes
(
axes
)
{
constructor_validate_and_infer_types
();
...
...
src/ngraph/op/softmax.hpp
View file @
41f2884f
...
...
@@ -27,6 +27,9 @@ namespace ngraph
class
Softmax
:
public
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a softmax operation.
///
/// \param arg Node that produces the first input tensor.<br>
...
...
src/ngraph/op/sqrt.cpp
View file @
41f2884f
...
...
@@ -21,8 +21,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Sqrt
::
type_name
{
"Sqrt"
};
op
::
Sqrt
::
Sqrt
(
const
shared_ptr
<
Node
>&
arg
)
:
UnaryElementwiseArithmetic
(
"Sqrt"
,
arg
)
:
UnaryElementwiseArithmetic
(
arg
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/sqrt.hpp
View file @
41f2884f
...
...
@@ -38,6 +38,9 @@ namespace ngraph
class
Sqrt
:
public
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a square operation.
///
/// \param arg Node that produces the input tensor.
...
...
src/ngraph/op/stop_gradient.cpp
View file @
41f2884f
...
...
@@ -21,8 +21,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
StopGradient
::
type_name
{
"StopGradient"
};
op
::
StopGradient
::
StopGradient
(
const
shared_ptr
<
Node
>&
arg
)
:
UnaryElementwiseArithmetic
(
"StopGradient"
,
arg
)
:
UnaryElementwiseArithmetic
(
arg
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/stop_gradient.hpp
View file @
41f2884f
...
...
@@ -26,6 +26,9 @@ namespace ngraph
class
StopGradient
:
public
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs StopGradient
///
/// \param arg Node that produces the input tensor.
...
...
src/ngraph/op/tan.cpp
View file @
41f2884f
...
...
@@ -22,8 +22,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Tan
::
type_name
{
"Tan"
};
op
::
Tan
::
Tan
(
const
shared_ptr
<
Node
>&
arg
)
:
UnaryElementwiseArithmetic
(
"Tan"
,
arg
)
:
UnaryElementwiseArithmetic
(
arg
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/tan.hpp
View file @
41f2884f
...
...
@@ -38,6 +38,9 @@ namespace ngraph
class
Tan
:
public
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a tangent operation.
///
/// \param arg Node that produces the input tensor.
...
...
src/ngraph/op/tanh.cpp
View file @
41f2884f
...
...
@@ -21,8 +21,10 @@
using
namespace
std
;
using
namespace
ngraph
;
const
string
op
::
Tanh
::
type_name
{
"Tanh"
};
op
::
Tanh
::
Tanh
(
const
shared_ptr
<
Node
>&
arg
)
:
UnaryElementwiseArithmetic
(
"Tanh"
,
arg
)
:
UnaryElementwiseArithmetic
(
arg
)
{
constructor_validate_and_infer_types
();
}
...
...
src/ngraph/op/tanh.hpp
View file @
41f2884f
...
...
@@ -26,6 +26,9 @@ namespace ngraph
class
Tanh
:
public
util
::
UnaryElementwiseArithmetic
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a hyperbolic tangent operation.
///
/// \param arg Node that produces the input tensor.
...
...
src/ngraph/runtime/cpu/op/batch_mat_mul_transpose.hpp
View file @
41f2884f
...
...
@@ -17,7 +17,6 @@
#pragma once
#include "ngraph/op/op.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
namespace
ngraph
{
...
...
@@ -35,7 +34,6 @@ namespace ngraph
class
BatchMatMulTranspose
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a batch of matmul product operation.
...
...
src/ngraph/runtime/cpu/op/batch_norm_relu.hpp
View file @
41f2884f
...
...
@@ -30,7 +30,6 @@ namespace ngraph
class
BatchNormTrainingRelu
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
CPU_BACKEND_API
BatchNormTrainingRelu
(
double
eps
,
...
...
@@ -60,7 +59,6 @@ namespace ngraph
class
BatchNormInferenceRelu
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
BatchNormInferenceRelu
(
double
eps
,
...
...
src/ngraph/runtime/cpu/op/bounded_relu.hpp
View file @
41f2884f
...
...
@@ -19,7 +19,6 @@
#include "ngraph/node.hpp"
#include "ngraph/op/op.hpp"
#include "ngraph/op/util/unary_elementwise_arithmetic.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
namespace
ngraph
{
...
...
@@ -30,7 +29,6 @@ namespace ngraph
class
BoundedRelu
:
public
ngraph
::
op
::
util
::
UnaryElementwiseArithmetic
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a BoundedRelu operation.
...
...
src/ngraph/runtime/cpu/op/conv_add.hpp
View file @
41f2884f
...
...
@@ -18,7 +18,6 @@
#include "ngraph/op/convolution.hpp"
#include "ngraph/op/op.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
namespace
ngraph
{
...
...
@@ -27,7 +26,6 @@ namespace ngraph
class
ConvolutionAdd
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
ConvolutionAdd
(
const
std
::
shared_ptr
<
op
::
Convolution
>&
conv
,
...
...
src/ngraph/runtime/cpu/op/conv_relu.hpp
View file @
41f2884f
...
...
@@ -28,7 +28,6 @@ namespace ngraph
class
ConvolutionRelu
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
CPU_BACKEND_API
ConvolutionRelu
(
const
std
::
shared_ptr
<
op
::
Convolution
>&
conv
);
...
...
src/ngraph/runtime/cpu/op/convert_layout.hpp
View file @
41f2884f
...
...
@@ -35,7 +35,6 @@ namespace ngraph
class
ConvertLayout
:
public
ngraph
::
op
::
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
CPU_BACKEND_API
ConvertLayout
(
...
...
src/ngraph/runtime/cpu/op/deconv.hpp
View file @
41f2884f
...
...
@@ -18,7 +18,6 @@
#include "ngraph/op/convolution.hpp"
#include "ngraph/op/op.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
namespace
ngraph
{
...
...
@@ -28,7 +27,6 @@ namespace ngraph
class
DeconvolutionBias
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a batched-convolution data batch-backprop operation.
...
...
src/ngraph/runtime/cpu/op/dropout.hpp
View file @
41f2884f
...
...
@@ -17,7 +17,6 @@
#pragma once
#include "ngraph/op/op.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
#include "ngraph/util.hpp"
namespace
ngraph
...
...
@@ -27,7 +26,6 @@ namespace ngraph
class
Dropout
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
Dropout
(
const
Output
<
Node
>&
input
,
...
...
src/ngraph/runtime/cpu/op/group_conv_bias.hpp
View file @
41f2884f
...
...
@@ -17,7 +17,6 @@
#pragma once
#include "ngraph/op/fused/group_conv.hpp"
#include "ngraph/op/op.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
namespace
ngraph
{
...
...
@@ -28,7 +27,6 @@ namespace ngraph
class
GroupConvolutionBias
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
GroupConvolutionBias
(
const
std
::
shared_ptr
<
op
::
GroupConvolution
>&
conv
,
...
...
src/ngraph/runtime/cpu/op/halide_op.hpp
View file @
41f2884f
...
...
@@ -20,7 +20,6 @@
#include <vector>
#include "ngraph/op/op.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
namespace
ngraph
{
...
...
@@ -33,7 +32,6 @@ namespace ngraph
class
HalideOp
:
public
ngraph
::
op
::
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
HalideOp
(
const
OutputVector
&
args
,
...
...
src/ngraph/runtime/cpu/op/leaky_relu.hpp
View file @
41f2884f
...
...
@@ -19,7 +19,6 @@
#include "ngraph/node.hpp"
#include "ngraph/op/op.hpp"
#include "ngraph/op/util/unary_elementwise_arithmetic.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
namespace
ngraph
{
...
...
@@ -31,7 +30,6 @@ namespace ngraph
class
CPULeakyRelu
:
public
ngraph
::
op
::
util
::
UnaryElementwiseArithmetic
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a CPULeakyRelu operation.
...
...
src/ngraph/runtime/cpu/op/lstm.hpp
View file @
41f2884f
...
...
@@ -17,7 +17,6 @@
#pragma once
#include "ngraph/op/op.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
#include "ngraph/runtime/cpu/op/rnn_utils.hpp"
#include "ngraph/util.hpp"
...
...
@@ -28,7 +27,6 @@ namespace ngraph
class
Lstm
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
// INPUTS:
...
...
src/ngraph/runtime/cpu/op/matmul_bias.hpp
View file @
41f2884f
...
...
@@ -27,7 +27,6 @@ namespace ngraph
class
MatmulBias
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
CPU_BACKEND_API
MatmulBias
(
const
Output
<
Node
>&
W
,
...
...
src/ngraph/runtime/cpu/op/max_pool_with_indices.hpp
View file @
41f2884f
...
...
@@ -32,7 +32,6 @@ namespace ngraph
class
MaxPoolWithIndices
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
CPU_BACKEND_API
MaxPoolWithIndices
(
const
Output
<
Node
>&
arg
,
...
...
@@ -68,7 +67,6 @@ namespace ngraph
class
MaxPoolWithIndicesBackprop
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
CPU_BACKEND_API
MaxPoolWithIndicesBackprop
(
const
Output
<
Node
>&
arg_forward
,
...
...
src/ngraph/runtime/cpu/op/quantized_matmul.hpp
View file @
41f2884f
...
...
@@ -19,7 +19,6 @@
#include <utility>
#include "ngraph/op/op.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
namespace
ngraph
{
...
...
@@ -28,7 +27,6 @@ namespace ngraph
class
QuantizedMatmul
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
QuantizedMatmul
(
const
Output
<
Node
>&
data
,
...
...
src/ngraph/runtime/cpu/op/rnn.hpp
View file @
41f2884f
...
...
@@ -48,7 +48,6 @@ namespace ngraph
class
Rnn
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
CPU_BACKEND_API
Rnn
(
const
Output
<
Node
>&
src_layer
,
...
...
src/ngraph/runtime/cpu/op/sigmoid_mul.hpp
View file @
41f2884f
...
...
@@ -30,7 +30,6 @@ namespace ngraph
class
SigmoidMultiply
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// Defines valid function types
...
...
@@ -69,7 +68,6 @@ namespace ngraph
class
SigmoidMultiplyBackprop
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
typedef
SigmoidMultiply
::
FunctionType
FunctionType
;
...
...
src/ngraph/runtime/cpu/op/update_slice.hpp
View file @
41f2884f
...
...
@@ -18,7 +18,6 @@
#include "ngraph/coordinate.hpp"
#include "ngraph/op/op.hpp"
#include "ngraph/runtime/cpu/cpu_backend_visibility.h"
#include "ngraph/strides.hpp"
namespace
ngraph
...
...
@@ -51,7 +50,6 @@ namespace ngraph
class
UpdateSlice
:
public
Op
{
public
:
CPU_BACKEND_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
/// \brief Constructs a tensor slice update operation.
...
...
src/ngraph/runtime/plaidml/plaidml_ops_convolution.hpp
View file @
41f2884f
...
...
@@ -39,7 +39,6 @@ namespace ngraph
class
ngraph
::
runtime
::
plaidml
::
op
::
Convolution
final
:
public
ngraph
::
op
::
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
Convolution
(
std
::
shared_ptr
<
ngraph
::
op
::
Convolution
>
src
,
...
...
@@ -66,7 +65,6 @@ private:
class
ngraph
::
runtime
::
plaidml
::
op
::
ConvolutionBackpropData
final
:
public
ngraph
::
op
::
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
ConvolutionBackpropData
(
std
::
shared_ptr
<
ngraph
::
op
::
ConvolutionBackpropData
>
src
,
...
...
@@ -93,7 +91,6 @@ private:
class
ngraph
::
runtime
::
plaidml
::
op
::
ConvolutionBackpropFilters
final
:
public
ngraph
::
op
::
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
ConvolutionBackpropFilters
(
std
::
shared_ptr
<
ngraph
::
op
::
ConvolutionBackpropFilters
>
src
,
...
...
src/ngraph/runtime/plaidml/plaidml_ops_implicit_broadcast.hpp
View file @
41f2884f
...
...
@@ -40,7 +40,6 @@ namespace ngraph
class
ngraph
::
runtime
::
plaidml
::
op
::
ImplicitBroadcast
final
:
public
ngraph
::
op
::
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
ImplicitBroadcast
(
const
Output
<
Node
>&
input
,
const
Shape
&
shape
);
...
...
src/ngraph/runtime/plaidml/plaidml_ops_replicate.hpp
View file @
41f2884f
...
...
@@ -39,7 +39,6 @@ namespace ngraph
class
ngraph
::
runtime
::
plaidml
::
op
::
Replicate
final
:
public
ngraph
::
op
::
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
Replicate
(
const
Output
<
Node
>&
arg
,
std
::
size_t
replication_axis
,
std
::
size_t
replication_count
);
...
...
src/ngraph/runtime/plaidml/plaidml_ops_winograd.hpp
View file @
41f2884f
...
...
@@ -38,7 +38,6 @@ namespace ngraph
class
ngraph
::
runtime
::
plaidml
::
op
::
Winograd
final
:
public
ngraph
::
op
::
Op
{
public
:
NGRAPH_API
static
const
std
::
string
type_name
;
const
std
::
string
&
description
()
const
override
{
return
type_name
;
}
Winograd
(
std
::
shared_ptr
<
Convolution
>
conv
,
const
OutputVector
&
args
);
...
...
test/backend/fused_op.in.cpp
View file @
41f2884f
...
...
@@ -1540,8 +1540,7 @@ NGRAPH_TEST(${BACKEND_NAME}, group_conv_transpose)
-
0.0270785
f
,
-
0.00680824
f
,
-
0.06650258
f
,
0.08004665
f
,
0.07918708
f
,
-
0.0724144
f
,
0.06256775
f
,
-
0.17838378
f
,
-
0.18863615
f
,
0.20064656
f
,
0.133717
f
,
-
0.06876295
f
,
-
0.06398046
f
,
-
0.00864975
f
,
0.19289537
f
,
-
0.01490572
f
,
-
0.13673618
f
,
0.01949645
f
});
test_case
.
set_tolerance
(
3
);
test_case
.
run
();
test_case
.
run
(
DEFAULT_FLOAT_TOLERANCE_BITS
+
1
);
}
NGRAPH_TEST
(
$
{
BACKEND_NAME
},
group_conv_transpose_output_shape
)
...
...
test/onnx/onnx_import_rnn.in.cpp
View file @
41f2884f
...
...
@@ -104,8 +104,7 @@ NGRAPH_TEST(onnx_${BACKEND_NAME}, model_lstm_fwd_with_clip)
// We have to enlarge tolerance bits to 3 - it's only one bit more than default value.
// The discrepancies may occur at most on 7th decimal position.
test_case
.
set_tolerance
(
3
);
test_case
.
run
();
test_case
.
run
(
DEFAULT_FLOAT_TOLERANCE_BITS
+
1
);
}
NGRAPH_TEST
(
onnx_
$
{
BACKEND_NAME
},
model_lstm_fwd_mixed_seq
)
...
...
@@ -144,8 +143,7 @@ NGRAPH_TEST(onnx_${BACKEND_NAME}, model_lstm_fwd_mixed_seq)
// We have to enlarge tolerance bits to 3 - it's only one bit more than default value.
// The discrepancies may occur at most on 7th decimal position.
test_case
.
set_tolerance
(
3
);
test_case
.
run
();
test_case
.
run
(
DEFAULT_FLOAT_TOLERANCE_BITS
+
1
);
}
NGRAPH_TEST
(
onnx_
$
{
BACKEND_NAME
},
model_lstm_fwd_hardsigmoid_activation
)
...
...
@@ -201,8 +199,7 @@ NGRAPH_TEST(onnx_${BACKEND_NAME}, model_lstm_fwd_hardsigmoid_activation)
test_case
.
add_expected_output
<
float
>
(
Shape
{
1
,
1
,
2
},
{
0.19017234
f
,
0.00356848
f
});
// The discrepancies occur at most at 18th mantissa bit - 8th decimal position.
test_case
.
set_tolerance
(
6
);
test_case
.
run
();
test_case
.
run
(
DEFAULT_FLOAT_TOLERANCE_BITS
+
4
);
}
NGRAPH_TEST
(
onnx_
$
{
BACKEND_NAME
},
model_lstm_fwd_large_batch_no_clip
)
...
...
@@ -307,8 +304,7 @@ NGRAPH_TEST(onnx_${BACKEND_NAME}, model_lstm_bdir_short_input_seq)
test_case
.
add_expected_output
<
float
>
(
Shape
{
2
,
1
,
2
},
{
-
0.0251062
f
,
0.0561262
f
,
-
0.0318928
f
,
0.0762679
f
});
test_case
.
set_tolerance
(
DEFAULT_FLOAT_TOLERANCE_BITS
+
3
);
test_case
.
run
();
test_case
.
run
(
DEFAULT_FLOAT_TOLERANCE_BITS
+
3
);
}
NGRAPH_TEST
(
onnx_
$
{
BACKEND_NAME
},
model_lstm_mixed_seq_reverse
)
...
...
@@ -353,6 +349,5 @@ NGRAPH_TEST(onnx_${BACKEND_NAME}, model_lstm_mixed_seq_reverse)
Shape
{
1
,
2
,
3
},
{
0.52497941
f
,
0.54983425
f
,
0.5744428
f
,
1.34960834
f
,
1.54772296
f
,
1.65633056
f
});
test_case
.
set_tolerance
(
DEFAULT_FLOAT_TOLERANCE_BITS
+
1
);
test_case
.
run
();
test_case
.
run
(
DEFAULT_FLOAT_TOLERANCE_BITS
+
1
);
}
test/onnx/onnxifi.cpp
View file @
41f2884f
...
...
@@ -17,7 +17,7 @@
#include <cstring>
#include <gtest/gtest.h>
#include <onnxifi.h>
#include <onnx
/onnx
ifi.h>
#include "ngraph/runtime/backend_manager.hpp"
...
...
test/util/test_case.cpp
View file @
41f2884f
...
...
@@ -19,8 +19,9 @@
#include "gtest/gtest.h"
#include "ngraph/assertion.hpp"
void
ngraph
::
test
::
NgraphTestCase
::
run
()
void
ngraph
::
test
::
NgraphTestCase
::
run
(
size_t
tolerance_bits
)
{
m_tolerance_bits
=
tolerance_bits
;
const
auto
&
function_results
=
m_function
->
get_results
();
NGRAPH_CHECK
(
m_expected_outputs
.
size
()
==
function_results
.
size
(),
"Expected number of outputs is different from the function's number of results."
);
...
...
@@ -52,12 +53,6 @@ void ngraph::test::NgraphTestCase::run()
}
}
ngraph
::
test
::
NgraphTestCase
&
ngraph
::
test
::
NgraphTestCase
::
set_tolerance
(
int
tolerance_bits
)
{
m_tolerance_bits
=
tolerance_bits
;
return
*
this
;
}
ngraph
::
test
::
NgraphTestCase
&
ngraph
::
test
::
NgraphTestCase
::
dump_results
(
bool
dump
)
{
m_dump_results
=
dump
;
...
...
test/util/test_case.hpp
View file @
41f2884f
...
...
@@ -38,8 +38,6 @@ namespace ngraph
{
}
NgraphTestCase
&
set_tolerance
(
int
tolerance_bits
);
/// \brief Makes the test case print the expected and computed values to the console. This should only be used for debugging purposes.
///
/// Just before the assertion is done, the current test case will gather expected and computed values,
...
...
@@ -130,7 +128,7 @@ namespace ngraph
add_expected_output
(
expected_shape
,
value
);
}
void
run
();
void
run
(
size_t
tolerance_bits
=
DEFAULT_FLOAT_TOLERANCE_BITS
);
private
:
template
<
typename
T
>
...
...
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