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
56bd183a
Commit
56bd183a
authored
Apr 17, 2018
by
arogowie-intel
Committed by
Michał Karzyński
Apr 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor type annotation for reduce parameter. (#870)
parent
c6d1af4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
ops.py
python/ngraph/ops.py
+3
-3
types.py
python/ngraph/utils/types.py
+2
-3
No files found.
python/ngraph/ops.py
View file @
56bd183a
...
...
@@ -27,14 +27,14 @@ from ngraph.impl.op import Abs, Acos, Add, Asin, Atan, AvgPool, BatchNorm, Broad
Reduce
,
Relu
,
ReplaceSlice
,
Reshape
,
Reverse
,
Select
,
Sign
,
Sin
,
Sinh
,
Slice
,
Softmax
,
Sqrt
,
\
Subtract
,
Sum
,
Tan
,
Tanh
from
typing
import
Iterable
,
List
from
typing
import
Callable
,
Iterable
,
List
,
Union
from
ngraph.utils.broadcasting
import
get_broadcast_axes
from
ngraph.utils.decorators
import
nameable_op
,
binary_op
,
unary_op
from
ngraph.utils.input_validation
import
assert_list_of_ints
from
ngraph.utils.reduction
import
get_reduction_axes
from
ngraph.utils.types
import
NumericType
,
NumericData
,
TensorShape
,
make_constant_node
,
\
NodeInput
,
ScalarData
,
CallableData
NodeInput
,
ScalarData
from
ngraph.utils.types
import
get_element_type
...
...
@@ -637,7 +637,7 @@ def prod(node, reduction_axes=None, name=None):
@nameable_op
def
reduce
(
node
,
# type: Node
initial_value
,
# type: ScalarData
reduction_function
,
# type:
CallableData
reduction_function
,
# type:
Union[Callable, Function]
reduction_axes
=
None
,
# type: List[int]
name
=
None
,
# type: str
):
...
...
python/ngraph/utils/types.py
View file @
56bd183a
...
...
@@ -16,12 +16,12 @@
"""Functions related to converting between Python and numpy types and ngraph types."""
import
logging
from
typing
import
Callable
,
Union
,
List
from
typing
import
Union
,
List
import
numpy
as
np
from
ngraph.impl
import
Type
as
NgraphType
from
ngraph.impl
import
Function
,
Node
,
Shape
from
ngraph.impl
import
Node
,
Shape
from
ngraph.impl.op
import
Constant
from
ngraph.exceptions
import
NgraphTypeError
...
...
@@ -34,7 +34,6 @@ NumericData = Union[int, float, np.ndarray]
NumericType
=
Union
[
type
,
np
.
dtype
]
ScalarData
=
Union
[
int
,
float
]
NodeInput
=
Union
[
Node
,
NumericData
]
CallableData
=
Union
[
Callable
,
Function
]
ngraph_to_numpy_types_map
=
[
(
NgraphType
.
boolean
,
np
.
bool
),
...
...
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