Commit 41a4d55f authored by Sang Ik Lee's avatar Sang Ik Lee Committed by Scott Cyphers

Silee2/single repo (#646)

* Wrapped convolution, max_pool, replace_slice, slice

* Friendly API for Ngraph++ Python bindings

* code review

* Update incorrect ngraph version used in README.md and add ngraph version
in file ngraph_ref

* Update ngraph-neon

* Friendly API for Ngraph++ Python bindings

* Flake8 style fix

* Friendly API for Ngraph++ Python bindings

* code review

* Update setup.py.in to include ngraph_api.

* Update ngraph-neon.

* Create separate build scripts for python2 and python3.

* Update ngraph-neon.

*  Tox configuration

 * automatically create virtualenvs for Python 2 and Python 3
 * run unit tests using pytest
 * check that code style is compliant with PEP8 using Flake8
 * run static type checking using MyPy

 See README.md for usage information.

* Unary Ops

Includes:

* abs
* ceil
* exp
* floor
* log
* neg
* sqrt

* Added MaxPool test

* Added Convolution op test

* mv mnist to examples/

* Enabled reverse op test

* Review fixes

* Review fixes pt.2

* Update ngraph-neon.

* Update setup.py.in

* Update ngraph-neon.

* Enable broadcasting

* Enable div op

* Enable mul op

* Enable sub op

* Enable add op

* Fix style and types for tox

* Review fixes

* Add docstrings

* Up to date with private-ngraph-cpp

* Update ngraph_ref

* Update ngraph-neon.

* Helper function for Constant Node

* Minimum and Maximum Ops

* Add dtype param to ng.constant

* add LICENSE and switch to Intel Copyright

* Added conv brop ops

* Fix pep8 warning in copyright

* Added convolution test

* Fixed copyright header

* Additional style checks

Includes:
* Do not use mutable data structures for argument defaults.

* Helper ng.equal

* Update ngraph-neon.

* Added convolution brop test

* Fixed format

* Add max pooling backprop.

* Add missing change.

* Fix style and add a Node method.

* Update ngraph-neon.

* Implicit casting of scalar values to Nodes in API helper functions

* Implicit casting unit tests

* Support for ngraph boolean type

* Add AvgPool support. Test cases will be added later.

* Update ngraph-neon.

* Extend Node class to support binary operators

* updating cpp master

* Update ngraph_ref

* Update ngraph-neon.

* Extend Node class to support more binary operators

* Bugfix for Constant op test

* Fix for reversed operators

* Enable tanh op

* Flake8-Bugbear requires Python3

* Fix for node with empty shape

* Wrapping serialize function

* Update setup.py.in

* Update __init__.py

* Fix import for static type checking.

* Enable logical ops

* Update ngraph-neon

* Enable dot op.

* Raise an error when user provided data that we currently don't support.

* Change raised error type to more appropriate.

* Fix: remove superfluous user input checking.

Actually Dot function inside ngraph++ performs input validation. The error
checking we want to do should be within ngraph_onnx interface.

* Enable conv2d op

* Added convolution test

* Remove currently unused arguments.

Dot can determine reduction axes inside ngraph++ for <= 2D cases.

* Fix function signature type annotation.

* Updated convolution test

* Added argon backend

* Update wrappers to match ngraph 8ad86ab9

* Update ngraph-neon.

* Update ngraph to d2d0196b

* Update python binding.

* Limit number of threads for parallel build.

* Update python wrapper.

* Update AvgPool constructor.

* Update python wrapper.

* Add Reshape op.

* Better conv default parameters

* Enable sum op

* Add reshape operation documentation.

* Review fix

* Added gpu skip

* API - Enable Pooling Ops (#55)

* Enable AVG Pooling OP

* Enable MAX Pooling OP

* Review fix

* Update python wrappers.

* Fixing the default argument handling for serializer function

* Update python wrapper.

* API - Change default Runtime to CPU (#58)

* Fix RuntimeError: function fails to compile

* Change default Runtime to CPU

* Fix for tox tests on CPU backend

* API - Add serialize method to Computation class

* Sync ngraph-cpp part 1

* Sync ngraph-cpp remaining

* Sync continued

* Sync to ngraph-cpp part 3

* Sync -- Changing test file

* update ref spec

* update cpp ref

* Update setup.py.in and rename concatenate.cpp and concatenate.hpp to concat.cpp and concat.hpp

* Add missing source file in setup.py.in

* Wrap manager class for calling the reshape elimination pass

* header file change

* Rename pass to passes to avoid python keyword conflict

* file rename

* Add src file in setup.py

* private-ngraph-cpp renamed to ngraph-cpp

* API - Integrate Shape objects (#66)

* Speedup for broadcasting in python_api

* Wrap relu & relubackprop op

* Type in setup.py

* Wrap Max op

* Wrap Product op

* Wrap Allreduce op

* Wrap FunctionCall op

* include function header file

* Wrap GetOutputElement op

* Wrap Min op

* Update ngraph cpp master

* Wrap BatchNorm op

* Wrap Softmax op

* Fix in setup.py, batchnorm.cpp & softmax.cpp

* Add __repr__ function to Shape objects.

* updating commit hash in README

* Downgrade python to python3.5

* Correct implementation of __str__ and __repr__ wrappers for Shape object and their usage from Node and Parameter

* Update wrapper

* Update setup.py.in to match setup.py

* Update ngraph-cpp to 89da71d3

* Update wrapper.

* Add sum, max, min and prod interfaces to ng++ Sum, Max, Min, Product respectively

* Add unit test for max, min, sum, and prod operations.

* Update README: ngraph-cpp repo has been renamed to ngraph

* Change pybind11 as a source only CMake external project

* Update python wrapper.

* Move pybind11 download location and remove legacy setup.py

* Update wrapper.

* Change package name from pyngraph to ngraph

* Remove python submodule.

* Move .gitignore

* Fix compilation issue after serializer api update.

* Remove files accidentally added by last RP to wrapper repo.

* Add missing packages to setup.py.in

* Fix module path issue.

* fix goe (jayaram)

* Fix wrapper and ngraph_api tests

* Add minimal documentation for the python wrappers.

* Add test_reduction.py in ngraph_api

* Update python nGraph doc.

* Remove commented out code.

* update README.md, delete ngraph_ref, fix tox

* Revert "Add minimal documentation for the python wrappers."

This reverts commit 2e61c698bd15f3b08dc096d4b1774d0cb52041ee.

* Revert incorrect way of adding doc.

* Revert incorrect way of adding doc.
This reverts commit 2e61c698bd15f3b08dc096d4b1774d0cb52041ee.

* Move conftest.py and fix in README

* Add minimal docstring for python wrappers.

* Format Wrapper cpp code
parent 08a574e8
......@@ -44,9 +44,10 @@ pushd "${THIS_SCRIPT_DIR}/.."
declare ARGON_SRC_DIR="build/third-party/argon_transformer/src/ext_argon_transformer/src"
declare ARGON_TEST_DIR="build/third-party/argon_transformer/src/ext_argon_transformer/test"
declare PYBIND_WRAPPER="python/pyngraph"
declare ROOT_SUBDIR
for ROOT_SUBDIR in src test ${ARGON_SRC_DIR} ${ARGON_TEST_DIR}; do
for ROOT_SUBDIR in src test ${ARGON_SRC_DIR} ${ARGON_TEST_DIR} ${PYBIND_WRAPPER}; do
if ! [[ -d "${ROOT_SUBDIR}" ]]; then
bash_lib_status "In directory '$(pwd)', no subdirectory named '${ROOT_SUBDIR}' was found."
else
......
tmp/
.idea
.pytest_cache/
### Standard Python .gitignore file: https://github.com/github/gitignore/blob/master/Python.gitignore ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
.static_storage/
.media/
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
### Standard Mac OS .gitignore file: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
cmake_minimum_required (VERSION 3.1)
# Suppress an OS X-specific warning.
if (POLICY CMP0042)
cmake_policy(SET CMP0042 OLD)
endif()
project (pyngraph)
include(ExternalProject)
ExternalProject_Add(
pybind11
GIT_REPOSITORY "https://github.com/jagerman/pybind11.git"
GIT_TAG "allow-nonconstructible-holders"
SOURCE_DIR "${CMAKE_BINARY_DIR}/pybind11"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
#
# The user can always override this by using the cmake command listed below.
if (DEFINED NGRAPH_INSTALL_PREFIX)
if(NOT EXISTS ${NGRAPH_INSTALL_PREFIX}/include/ngraph)
message(FATAL_ERROR "Cannot find ngraph library in ${NGRAPH_INSTALL_PREFIX} make sure that NGRAPH_INSTALL_PREFIX is set correctly")
endif()
set(USE_EMBEDDED_NGRAPH FALSE)
else()
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/../src/ngraph)
message(FATAL_ERROR "Cannot find ngraph source in ${CMAKE_SOURCE_DIR}/..")
endif()
set(USE_EMBEDDED_NGRAPH TRUE)
set(NGRAPH_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/ngraph_dist)
endif()
set(SETUP_PY_IN "${CMAKE_SOURCE_DIR}/setup.py.in")
set(SETUP_PY "${CMAKE_BINARY_DIR}/setup.py")
configure_file(${SETUP_PY_IN} ${SETUP_PY})
if(USE_EMBEDDED_NGRAPH)
set(NGRAPH_SOURCE_DIR ${CMAKE_SOURCE_DIR}/..)
set(NGRAPH_CMAKE_ARGS "-DNGRAPH_INSTALL_PREFIX=${NGRAPH_INSTALL_PREFIX}")
if(APPLE)
set(NGRAPH_CMAKE_ARGS "-DCMAKE_MACOSX_RPATH=ON" ${NGRAPH_CMAKE_ARGS})
endif()
ExternalProject_Add(
ngraph
DOWNLOAD_COMMAND ""
SOURCE_DIR ${NGRAPH_SOURCE_DIR}
CMAKE_ARGS ${NGRAPH_CMAKE_ARGS}
)
endif()
This diff is collapsed.
# nGraph python binding
## Installation (If you haven't build nGraph yet.)
Checkout nGraph and python wrapper code and build bdist wheel.
```
git clone https://github.com/NervanaSystems/ngraph.git
cd ngraph/python
```
```
pip install wheel
```
To build python2 bdist wheel type
```
./build_python2_wheel.sh
```
To build python3 bdist wheel type
```
./build_python3_wheel.sh
```
The bdist wheel will be placed in ngraph/python/build/dist
Activate your virtual environment and install the bdist wheel
```
pip install -U <full path to the bdist wheel>
```
For example, On MacOS you would run a command like,
```
pip install -U build/dist/ngraph-0.0.1-cp35-cp35m-linux_x86_64.whl
```
To run unit tests, first install additional required packages.
```
pip install -r test_requirements.txt
```
Then run a test.
```
pytest test/test_ops.py
pytest test/ngraph_api/*
```
## Running tests with tox
[Tox](https://tox.readthedocs.io/) is a Python [virtualenv](https://virtualenv.pypa.io/) management and test command line tool. In our project it automates:
* running unit tests using [pytest](https://docs.pytest.org/)
* checking that code style is compliant with [PEP8](https://www.python.org/dev/peps/pep-0008/) using [Flake8](http://flake8.pycqa.org/)
* static type checking using [MyPy](http://mypy.readthedocs.io)
* testing across Python 2 and 3
Installing and running test with Tox:
pip install tox
export NGRAPH_CPP_BUILD_PATH=<current working directory>/build/ngraph_dist/
export LD_LIBRARY_PATH=<current working directory>/build/ngraph_dist/lib/
tox
You can run tests using only Python 3 or 2 using the `-e` (environment) switch:
tox -e py36
tox -e py27
You can check styles in a particular code directory by specifying the path:
tox ngraph_api/
In case of problems, try to recreate the virtual environments by deleting the `.tox` directory:
```
rm -rf .tox
tox
```
#!/bin/sh
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
if [ -d build ]; then
rm -rf build
fi
mkdir build
cd build && cmake .. && make -j8 && python2 setup.py bdist_wheel
#!/bin/sh
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
if [ -d build ]; then
rm -rf build
fi
mkdir build
cd build && cmake .. && make -j8 && python3 setup.py bdist_wheel
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
"""Usage example for the ngraph Pythonic API."""
import numpy as np
import ngraph_api as ng
shape = [2, 2]
A = ng.parameter(shape, name='A')
B = ng.parameter(shape, name='B')
C = ng.parameter(shape, name='C')
# >>> print(A)
# <Parameter: 'A' (2, 2, float)>
model = (A + B) * C
# >>> print(model)
# <Node: 'Multiply_6'>
runtime = ng.runtime(manager_name='INTERPRETER')
# >>> print(runtime)
# <Runtime: Manager='INTERPRETER'>
computation = runtime.computation(model, A, B, C)
# >>> print(computation)
# <Computation: Multiply_6(A, B, C)>
value_a = np.array([[1, 2], [3, 4]], dtype=np.float32)
value_b = np.array([[5, 6], [7, 8]], dtype=np.float32)
value_c = np.array([[9, 10], [11, 12]], dtype=np.float32)
result = computation(value_a, value_b, value_c)
# >>> print(result)
# [[ 54. 80.]
# [110. 144.]]
print('Result = ', result)
#!/usr/bin/env python
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
from ngraph import Type, Function
from ngraph import Node
from ngraph.op import Parameter, Maximum, Reshape, Dot, Broadcast
from ngraph.op import Constant, Exp, Log, Sum
from ngraph.op import Greater, Convert, Reduce
from ngraph.op import OneHot
from typing import List, Dict, Set
float_element_type = Type.f32
int_element_type = Type.i32
bz = 53
lr = 0.2
Input = Parameter(float_element_type, [bz, 28, 28])
Label = Parameter(int_element_type, [bz])
LabelOneHot = Convert((OneHot(Label, [bz, 10], 1)), float_element_type)
MaxParam1 = Parameter(float_element_type, [])
MaxParam2 = Parameter(float_element_type, [])
MaxFn = Function([Maximum(MaxParam1, MaxParam2)],
[MaxParam1, MaxParam2],
'mnist')
def make_scalar_constant(elem_type, scalar, shape=None, axis_set=None):
# type: (int, float, List[int], Set[int]) -> float
"""Create a Constant node for scalar value."""
if shape is None:
shape = []
if axis_set is None:
axis_set = set()
scalar_shape = [] # type: List[int]
constant_op = Constant(elem_type, scalar_shape, [scalar])
constant_broadcast = Broadcast(constant_op, shape, axis_set)
return constant_broadcast
def make_float32_constant(scalar, shape=None, axis_set=None):
# type: (float, List[int], Set[int]) -> float
"""Create a Constant node for float value."""
if shape is None:
shape = []
if axis_set is None:
axis_set = set()
return make_scalar_constant(Type.f32, scalar, shape, axis_set)
def make_float32_constant_like(scalar, op): # type: (float, Node) -> float
"""Create a Constant node for float value."""
v = set()
shape = op.get_shape()
for i in range(len(shape)):
v.add(i)
return make_float32_constant(scalar, shape, v)
def transpose(op, order): # type: (Node, List[int]) -> Node
"""Transpose data via reshape."""
v = []
for i in range(len(order)):
v.append(op.get_shape()[order[i]])
new_shape = v
return Reshape(op, order, new_shape)
def relu(op): # type: (Node) -> Node
"""Relu operator."""
return Maximum(op, make_float32_constant_like(0., op))
# Flatten
X1 = Reshape(Input, [0, 1, 2], [bz, 784])
# Normalize
X2 = X1 / make_float32_constant_like(255., X1)
# Affine 1
W1 = Parameter(float_element_type, [784, 100])
b1 = Parameter(float_element_type, [100])
X3 = Dot(X2, W1) + Broadcast(b1, [bz, 100], {0})
X4 = relu(X3)
# Affine 2
W2 = Parameter(float_element_type, [100, 10])
b2 = Parameter(float_element_type, [10])
X5 = Dot(X4, W2) + Broadcast(b2, [bz, 10], {0})
# Softmax
Logits = X5
Exp = Exp(Logits)
Max = Reduce(Exp, make_float32_constant(0., [], set()), MaxFn, {1})
MaxBroadcast = Broadcast(Max, [bz, 10], {1})
Softmax = Exp / MaxBroadcast
# Loss
LogSoftmax = Log(Softmax)
Loss = Sum(LogSoftmax * LabelOneHot, {0, 1}) / make_float32_constant(float(bz), [], set())
# Derivatives
dLogits = Softmax - LabelOneHot
dX5 = dLogits
dX4 = Dot(dX5, transpose(W2, [1, 0]))
dW2 = Dot(transpose(X4, [1, 0]), dX5)
db2 = Sum(dX5, {0})
dX3 = Convert((Greater(X3, make_float32_constant(0., [bz, 100], {0, 1}))), float_element_type) * dX4
dX2 = Dot(dX3, transpose(W1, [1, 0]))
dW1 = Dot(transpose(X2, [1, 0]), dX3)
db1 = Sum(dX3, {0})
nW1 = W1 - make_float32_constant_like(lr, dW1) * dW1
nb1 = b1 - make_float32_constant_like(lr, db1) * db1
nW2 = W2 - make_float32_constant_like(lr, dW2) * dW2
nb2 = b2 - make_float32_constant_like(lr, db2) * db2
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
"""
Package: ngraph
Low level wrappers for the nGraph c++ api.
"""
# flake8: noqa
import sys
import six
# workaround to load the libngraph.so with RTLD_GLOBAL
if six.PY3:
import os
flags = os.RTLD_NOW | os.RTLD_GLOBAL
else:
import ctypes
flags = sys.getdlopenflags() | ctypes.RTLD_GLOBAL
sys.setdlopenflags(flags)
from _pyngraph import Function
from _pyngraph import Node
from _pyngraph import NodeVector
from _pyngraph import Type
from _pyngraph import TensorViewType
from _pyngraph import Shape
from _pyngraph import Strides
from _pyngraph import CoordinateDiff
from _pyngraph import AxisSet
from _pyngraph import AxisVector
from _pyngraph import Coordinate
from _pyngraph import serialize
from _pyngraph import util
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
"""
Package: ngraph.op
Low level wrappers for the nGraph c++ api in ngraph::op.
"""
# flake8: noqa
import sys
import six
# workaround to load the libngraph.so with RTLD_GLOBAL
if six.PY3:
import os
flags = os.RTLD_NOW | os.RTLD_GLOBAL
else:
import ctypes
flags = sys.getdlopenflags() | ctypes.RTLD_GLOBAL
sys.setdlopenflags(flags)
from _pyngraph.op import Abs
from _pyngraph.op import Acos
from _pyngraph.op import Add
from _pyngraph.op import Asin
from _pyngraph.op import Atan
from _pyngraph.op import AvgPool
from _pyngraph.op import AvgPoolBackprop
from _pyngraph.op import Broadcast
from _pyngraph.op import Ceiling
from _pyngraph.op import Concat
from _pyngraph.op import Constant
from _pyngraph.op import Convert
from _pyngraph.op import Convolution
from _pyngraph.op import ConvolutionBackpropData
from _pyngraph.op import ConvolutionBackpropFilters
from _pyngraph.op import Cos
from _pyngraph.op import Cosh
from _pyngraph.op import Divide
from _pyngraph.op import Dot
from _pyngraph.op import Equal
from _pyngraph.op import Exp
from _pyngraph.op import Floor
from _pyngraph.op import Greater
from _pyngraph.op import GreaterEq
from _pyngraph.op import Less
from _pyngraph.op import LessEq
from _pyngraph.op import Log
from _pyngraph.op import Max
from _pyngraph.op import MaxPool
from _pyngraph.op import MaxPoolBackprop
from _pyngraph.op import Maximum
from _pyngraph.op import Min
from _pyngraph.op import Minimum
from _pyngraph.op import Multiply
from _pyngraph.op import Negative
from _pyngraph.op import NotEqual
from _pyngraph.op import Not
from _pyngraph.op import OneHot
from _pyngraph.op import Op
from _pyngraph.op import Parameter
from _pyngraph.op import ParameterVector
from _pyngraph.op import Power
from _pyngraph.op import Reduce
from _pyngraph.op import ReplaceSlice
from _pyngraph.op import Reshape
from _pyngraph.op import Reverse
from _pyngraph.op import Select
from _pyngraph.op import Sign
from _pyngraph.op import Sin
from _pyngraph.op import Sinh
from _pyngraph.op import Slice
from _pyngraph.op import Sqrt
from _pyngraph.op import Subtract
from _pyngraph.op import Sum
from _pyngraph.op import Tan
from _pyngraph.op import Tanh
from _pyngraph.op import Relu
from _pyngraph.op import ReluBackprop
from _pyngraph.op import Product
from _pyngraph.op import AllReduce
from _pyngraph.op import FunctionCall
from _pyngraph.op import GetOutputElement
from _pyngraph.op import BatchNorm
from _pyngraph.op import BatchNormBackprop
from _pyngraph.op import Softmax
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
"""
Package: ngraph.op.util
Low level wrappers for the nGraph c++ api in ngraph::op::util.
"""
# flake8: noqa
import sys
import six
# workaround to load the libngraph.so with RTLD_GLOBAL
if six.PY3:
import os
flags = os.RTLD_NOW | os.RTLD_GLOBAL
else:
import ctypes
flags = sys.getdlopenflags() | ctypes.RTLD_GLOBAL
sys.setdlopenflags(flags)
from _pyngraph.op.util import RequiresTensorViewArgs
from _pyngraph.op.util import UnaryElementwise
from _pyngraph.op.util import UnaryElementwiseArithmetic
from _pyngraph.op.util import BinaryElementwise
from _pyngraph.op.util import BinaryElementwiseComparison
from _pyngraph.op.util import BinaryElementwiseArithmetic
from _pyngraph.op.util import OpAnnotations
from _pyngraph.op.util import ArithmeticReduction
\ No newline at end of file
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
# flake8: noqa
import sys
import six
# workaround to load the libngraph.so with RTLD_GLOBAL
if six.PY3:
import os
flags = os.RTLD_NOW | os.RTLD_GLOBAL
else:
import ctypes
flags = sys.getdlopenflags() | ctypes.RTLD_GLOBAL
sys.setdlopenflags(flags)
from _pyngraph.passes import Manager
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
# flake8: noqa
import sys
import six
# workaround to load the libngraph.so with RTLD_GLOBAL
if six.PY3:
import os
flags = os.RTLD_NOW | os.RTLD_GLOBAL
else:
import ctypes
flags = sys.getdlopenflags() | ctypes.RTLD_GLOBAL
sys.setdlopenflags(flags)
from _pyngraph.runtime import Backend
from _pyngraph.runtime import CallFrame
from _pyngraph.runtime import ExternalFunction
from _pyngraph.runtime import Manager
from _pyngraph.runtime import TensorView
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
"""ngraph module namespace, exposing factory functions for all ops and other classes."""
from ngraph_api.ops import absolute
from ngraph_api.ops import absolute as abs
from ngraph_api.ops import add
from ngraph_api.ops import avg_pool
from ngraph_api.ops import broadcast
from ngraph_api.ops import ceiling
from ngraph_api.ops import ceiling as ceil
from ngraph_api.ops import constant
from ngraph_api.ops import convert
from ngraph_api.ops import convolution
from ngraph_api.ops import divide
from ngraph_api.ops import dot
from ngraph_api.ops import equal
from ngraph_api.ops import exp
from ngraph_api.ops import floor
from ngraph_api.ops import greater
from ngraph_api.ops import greater_eq
from ngraph_api.ops import log
from ngraph_api.ops import less
from ngraph_api.ops import less_eq
from ngraph_api.ops import logical_not
from ngraph_api.ops import max
from ngraph_api.ops import maximum
from ngraph_api.ops import max_pool
from ngraph_api.ops import min
from ngraph_api.ops import minimum
from ngraph_api.ops import multiply
from ngraph_api.ops import negative
from ngraph_api.ops import not_equal
from ngraph_api.ops import parameter
from ngraph_api.ops import prod
from ngraph_api.ops import reshape
from ngraph_api.ops import sqrt
from ngraph_api.ops import subtract
from ngraph_api.ops import sum
from ngraph_api.ops import tanh
from ngraph_api.runtime import runtime
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
"""ngraph exceptions hierarchy. All exceptions are descendants of NgraphError."""
class NgraphError(Exception):
"""Base class for Ngraph exceptions."""
class UserInputError(NgraphError):
"""User provided unexpected input."""
class NgraphTypeError(NgraphError, TypeError):
"""Type mismatch error."""
This diff is collapsed.
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
"""Provide a layer of abstraction for the ngraph++ runtime environment."""
import logging
from typing import List
import numpy as np
from ngraph import Function, Node, serialize, TensorViewType, util
from ngraph.runtime import Manager
from ngraph.op import Parameter
from ngraph_api.utils.types import get_dtype, NumericData
log = logging.getLogger(__file__)
def runtime(manager_name='CPU'): # type: (str) -> 'Runtime'
"""Create a Runtime object (helper factory).
Use signature to parametrize runtime as needed.
"""
return Runtime(manager_name)
class Runtime:
"""Represents the ngraph++ runtime environment."""
def __init__(self, manager_name): # type: (str) -> None
self.manager_name = manager_name
self.manager = Manager.get(manager_name)
self.backend = self.manager.allocate_backend()
def __repr__(self): # type: () -> str
return '<Runtime: Manager=\'{}\'>'.format(self.manager_name)
def computation(self, node, *inputs): # type: (Node, *Node) -> 'Computation'
"""Return a callable Computation object."""
return Computation(self, node, *inputs)
class Computation:
"""ngraph callable computation object."""
def __init__(self, runtime, node, *parameters): # type: (Runtime, Node, *Parameter) -> None
self.runtime = runtime
self.node = node
self.parameters = parameters
self.tensor_views = [] # type: List[TensorViewType]
for parameter in parameters:
shape = parameter.get_shape()
element_type = parameter.get_element_type()
self.tensor_views.append(runtime.backend.make_primary_tensor_view(element_type, shape))
self.function = Function(self.node, self.parameters, 'ngraph_API_computation')
def __repr__(self): # type: () -> str
params_string = ', '.join([param.name for param in self.parameters])
return '<Computation: {}({})>'.format(self.node.name, params_string)
def __call__(self, *input_values): # type: (*NumericData) -> NumericData
"""Run computation on input values and return result."""
for tensor_view, value in zip(self.tensor_views, input_values):
if not isinstance(value, np.ndarray):
value = np.array(value)
Computation._write_ndarray_to_tensor_view(value, tensor_view)
result_element_type = self.node.get_element_type()
result_shape = self.node.get_shape()
result_dtype = get_dtype(result_element_type)
result_view = self.runtime.backend.make_primary_tensor_view(
result_element_type, result_shape)
result_arr = np.empty(result_shape, dtype=result_dtype)
external = self.runtime.manager.compile(self.function)
call_frame = self.runtime.backend.make_call_frame(external)
call_frame.call(self.tensor_views, [result_view])
Computation._read_tensor_view_to_ndarray(result_view, result_arr)
result_arr = result_arr.reshape(result_shape)
return result_arr
def serialize(self): # type: () -> str
"""Serialize function (compute graph) to a JSON string."""
return serialize(self.function)
@staticmethod
def _get_buffer_size(element_type, element_count): # type: (TensorViewType, int) -> int
return int((element_type.bitwidth / 8.0) * element_count)
@staticmethod
def _write_ndarray_to_tensor_view(value, tensor_view):
# type: (np.ndarray, TensorViewType) -> None
tensor_view_dtype = get_dtype(tensor_view.element_type)
if value.dtype != tensor_view_dtype:
log.warning(
'Attempting to write a %s value to a %s tensor. Will attempt type conversion.',
value.dtype,
tensor_view.element_type)
value = value.astype(tensor_view_dtype)
buffer_size = Computation._get_buffer_size(
tensor_view.element_type, tensor_view.element_count)
tensor_view.write(util.numpy_to_c(value), 0, buffer_size)
@staticmethod
def _read_tensor_view_to_ndarray(tensor_view, output):
# type: (TensorViewType, np.ndarray) -> None
buffer_size = Computation._get_buffer_size(
tensor_view.element_type, tensor_view.element_count)
tensor_view.read(util.numpy_to_c(output), 0, buffer_size)
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
"""Generic utilities. Factor related functions out to separate files."""
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
import logging
from typing import Optional, List
import ngraph_api as ng
from ngraph import AxisSet, Node
from ngraph_api.utils.types import TensorShape, get_dtype, make_constant_node, NodeInput
log = logging.getLogger(__file__)
def get_broadcast_axes(left_shape, right_shape, axis):
# type: (TensorShape, TensorShape, Optional[int]) -> AxisSet
"""Generate a list of broadcast axes for ngraph++ broadcast.
Informally, a broadcast "adds" axes to the input tensor,
replicating elements from the input tensor as needed to fill the new dimensions.
Function calculate which of the output axes is being so added.
For example, an output shape of `{2,5,6,2,8}` and input shape of `{2,6}` means
that the broadcast axes must be `{1,3,4}`.
"""
axes_indexes = list(range(0, len(left_shape)))
if axis is None:
right_begin = len(left_shape) - len(right_shape)
else:
right_begin = axis
right_axes_indexes = list(range(right_begin, right_begin + len(right_shape)))
for index in reversed(right_axes_indexes):
del axes_indexes[index]
return AxisSet(set(axes_indexes))
def as_elementwise_compatible_nodes(*input_values): # type: (*NodeInput) -> List[Node]
"""Return all input values as ngraph Nodes with the same shape and element type.
Scalar values will be converted to ngraph Constant Nodes.
"""
input_nodes = [node for node in input_values
if issubclass(type(node), Node)] # type: List[Node]
if not input_nodes:
raise NotImplementedError('Operations on scalars only are not supported.')
shapes = {tuple(node.shape) for node in input_nodes}
if len(shapes) > 1:
log.warning('More than one different shape in input nodes %s.', input_nodes)
types = {node.get_element_type() for node in input_nodes}
if len(types) > 1:
log.warning('More than one different data type in input nodes %s.', input_nodes)
sorted_shapes = sorted(shapes, key=len)
broadcast_shape = sorted_shapes.pop()
broadcast_dtype = get_dtype(types.pop())
output_nodes = []
for input_value in input_values:
if issubclass(type(input_value), Node):
input_value = ng.broadcast(input_value, broadcast_shape)
output_nodes.append(input_value)
else:
input_value = make_constant_node(input_value, dtype=broadcast_dtype)
output_nodes.append(ng.broadcast(input_value, broadcast_shape))
return output_nodes
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
from functools import wraps
from typing import Any, Callable
from ngraph import Node
from ngraph_api.utils.types import as_node, NodeInput
from ngraph_api.utils.broadcasting import as_elementwise_compatible_nodes
def _set_node_name(node, **kwargs): # type: (Node, **Any) -> Node
if 'name' in kwargs:
node.name = kwargs['name']
return node
def nameable_op(node_factory_function): # type: (Callable) -> Callable
"""Set the name to the ngraph operator returned by the wrapped function."""
@wraps(node_factory_function)
def wrapper(*args, **kwargs): # type: (*Any, **Any) -> Node
node = node_factory_function(*args, **kwargs)
node = _set_node_name(node, **kwargs)
return node
return wrapper
def unary_op(node_factory_function): # type: (Callable) -> Callable
"""Convert the first input value to a Constant Node if a scalar value is detected."""
@wraps(node_factory_function)
def wrapper(input_value, *args, **kwargs): # type: (NodeInput, *Any, **Any) -> Node
input_node = as_node(input_value)
node = node_factory_function(input_node, *args, **kwargs)
node = _set_node_name(node, **kwargs)
return node
return wrapper
def binary_op(node_factory_function): # type: (Callable) -> Callable
"""Convert the first two input values to Constant Nodes if scalar values are detected."""
@wraps(node_factory_function)
def wrapper(left, right, *args, **kwargs): # type: (NodeInput, NodeInput, *Any, **Any) -> Node
left, right = as_elementwise_compatible_nodes(left, right)
node = node_factory_function(left, right, *args, **kwargs)
node = _set_node_name(node, **kwargs)
return node
return wrapper
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
"""Helper functions for validating user input."""
import logging
from typing import Iterable
from ngraph_api.exceptions import UserInputError
log = logging.getLogger(__file__)
def assert_list_of_ints(value_list, message): # type: (Iterable[int], str) -> None
"""Verify that the provided value is an iterable of integers."""
try:
for value in value_list:
if not isinstance(value, int):
raise TypeError
except TypeError:
log.warning(message)
raise UserInputError(message, value_list)
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
from typing import Iterable, Optional
from ngraph import Node
def get_reduction_axes(node, reduction_axes):
# type: (Node, Optional[Iterable[int]]) -> Iterable[int]
"""Get reduction axes if it is None and convert it to set if its type is different.
If reduction_axes is None we default to reduce all axes.
:param node: The node we fill reduction axes for.
:param reduction_axes: The collection of indices of axes to reduce. May be None.
:return: Set filled with indices of axes we want to reduce.
"""
if reduction_axes is None:
reduction_axes = set(range(len(node.shape)))
if type(reduction_axes) is not set:
reduction_axes = set(reduction_axes)
return reduction_axes
# ******************************************************************************
# Copyright 2018 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.
# ******************************************************************************
"""Functions related to converting between Python and numpy types and ngraph types."""
import logging
from typing import Union, List
import numpy as np
from ngraph import Type as NgraphType
from ngraph import Node, Shape
from ngraph.op import Constant
from ngraph_api.exceptions import NgraphTypeError
log = logging.getLogger(__file__)
TensorShape = List[int]
NumericData = Union[int, float, np.ndarray]
NumericType = Union[type, np.dtype]
NodeInput = Union[Node, NumericData]
ngraph_to_numpy_types_map = [
(NgraphType.boolean, np.bool),
(NgraphType.f32, np.float32),
(NgraphType.f64, np.float64),
(NgraphType.i8, np.int8),
(NgraphType.i16, np.int16),
(NgraphType.i32, np.int32),
(NgraphType.i64, np.int64),
(NgraphType.u8, np.uint8),
(NgraphType.u16, np.uint16),
(NgraphType.u32, np.uint32),
(NgraphType.u64, np.uint64),
]
def get_element_type(data_type): # type: (NumericType) -> NgraphType
"""Return an ngraph element type for a Python type or numpy.dtype."""
if data_type is int:
log.warning('Converting int type of undefined bitwidth to 32-bit ngraph integer.')
return NgraphType.i32
if data_type is float:
log.warning('Converting float type of undefined bitwidth to 32-bit ngraph float.')
return NgraphType.f32
ng_type = next((ng_type for (ng_type, np_type)
in ngraph_to_numpy_types_map if np_type == data_type), None)
if ng_type:
return ng_type
raise NgraphTypeError('Unidentified data type %s', data_type)
def get_dtype(ngraph_type): # type: (NgraphType) -> np.dtype
"""Return a numpy.dtype for an ngraph element type."""
np_type = next((np_type for (ng_type, np_type)
in ngraph_to_numpy_types_map if ng_type == ngraph_type), None)
if np_type:
return np.dtype(np_type)
raise NgraphTypeError('Unidentified data type %s', ngraph_type)
def get_ndarray(data): # type: (NumericData) -> np.ndarray
"""Wrap data into a numpy ndarray."""
if type(data) == np.ndarray:
return data
return np.array(data)
def make_constant_node(value, dtype=None): # type: (NumericData, NumericType) -> Constant
"""Return an ngraph Constant node with the specified value."""
ndarray = get_ndarray(value)
if dtype:
element_type = get_element_type(dtype)
else:
element_type = get_element_type(ndarray.dtype)
return Constant(element_type, Shape(ndarray.shape), ndarray.flatten().tolist())
def as_node(input_value): # type: (NodeInput) -> Node
"""Return input values as nodes. Scalars will be converted to Constant nodes."""
if issubclass(type(input_value), Node):
return input_value
return make_constant_node(input_value)
def as_nodes(*input_values): # type: (*NodeInput) -> List[Node]
"""Return input values as nodes. Scalars will be converted to Constant nodes."""
return [as_node(input_value) for input_value in input_values]
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/axis_set.hpp" //ngraph::AxisSet
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/axis_set.hpp"
namespace py = pybind11;
void regclass_pyngraph_AxisSet(py::module m)
{
py::class_<ngraph::AxisSet, std::shared_ptr<ngraph::AxisSet>> axis_set(m, "AxisSet");
axis_set.doc() = "ngraph.AxisSet wraps ngraph::AxisSet";
axis_set.def(py::init<const std::initializer_list<size_t>&>());
axis_set.def(py::init<const std::set<size_t>&>());
axis_set.def(py::init<const ngraph::AxisSet&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_AxisSet(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/axis_vector.hpp" //ngraph::AxisVector
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/axis_vector.hpp"
namespace py = pybind11;
void regclass_pyngraph_AxisVector(py::module m)
{
py::class_<ngraph::AxisVector, std::shared_ptr<ngraph::AxisVector>> axis_vector(m,
"AxisVector");
axis_vector.doc() = "ngraph.AxisVector wraps ngraph::AxisVector";
axis_vector.def(py::init<const std::initializer_list<size_t>&>());
axis_vector.def(py::init<const std::vector<size_t>&>());
axis_vector.def(py::init<const ngraph::AxisVector&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_AxisVector(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/coordinate.hpp" //ngraph::Coordinate
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/coordinate.hpp"
namespace py = pybind11;
void regclass_pyngraph_Coordinate(py::module m)
{
py::class_<ngraph::Coordinate, std::shared_ptr<ngraph::Coordinate>> coordinate(m, "Coordinate");
coordinate.doc() = "ngraph.Coordinate wraps ngraph::Coordinate";
coordinate.def(py::init<const std::initializer_list<size_t>&>());
coordinate.def(py::init<const ngraph::Shape&>());
coordinate.def(py::init<const std::vector<size_t>&>());
coordinate.def(py::init<const ngraph::Coordinate&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Coordinate(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/coordinate_diff.hpp" //ngraph::CoordinateDiff
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/coordinate_diff.hpp"
namespace py = pybind11;
void regclass_pyngraph_CoordinateDiff(py::module m)
{
py::class_<ngraph::CoordinateDiff, std::shared_ptr<ngraph::CoordinateDiff>> coordinate_diff(
m, "CoordinateDiff");
coordinate_diff.doc() = "ngraph.CoordinateDiff wraps ngraph::CoordinateDiff";
coordinate_diff.def(py::init<const std::initializer_list<ptrdiff_t>&>());
coordinate_diff.def(py::init<const std::vector<ptrdiff_t>&>());
coordinate_diff.def(py::init<const ngraph::CoordinateDiff&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_CoordinateDiff(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/function.hpp" //ngraph::Function
#include "ngraph/ops/parameter.hpp" //ngraph::op::Parameter
#include "ngraph/types/type.hpp" //ngraph::TensorViewType
#include "pyngraph/function.hpp"
namespace py = pybind11;
void regclass_pyngraph_Function(py::module m)
{
py::class_<ngraph::Function, std::shared_ptr<ngraph::Function>> function(m, "Function");
function.doc() = "ngraph.Function wraps ngraph::Function";
function.def(py::init<const ngraph::NodeVector&,
const std::vector<std::shared_ptr<ngraph::op::Parameter>>&,
const std::string&>());
function.def(py::init<const std::shared_ptr<ngraph::Node>&,
const std::vector<std::shared_ptr<ngraph::op::Parameter>>&,
const std::string&>());
function.def("get_output_size", &ngraph::Function::get_output_size);
function.def("get_output_op", &ngraph::Function::get_output_op);
function.def("get_output_element_type", &ngraph::Function::get_output_element_type);
function.def("get_output_shape", &ngraph::Function::get_output_shape);
function.def("get_parameters", &ngraph::Function::get_parameters);
function.def("get_results", &ngraph::Function::get_results);
function.def("get_result", &ngraph::Function::get_result);
function.def("get_name", &ngraph::Function::get_name);
function.def("set_name", &ngraph::Function::set_name);
}
/*******************************************************************************
* Copyright 2017-2018 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_Function(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/node.hpp" // ngraph::Node
#include "ngraph/ops/add.hpp" // ngraph::op::Add
#include "ngraph/ops/divide.hpp" // ngraph::op::Divide
#include "ngraph/ops/multiply.hpp" // ngraph::op::Multiply
#include "ngraph/ops/subtract.hpp" // ngraph::op::Subtract
#include "pyngraph/node.hpp"
namespace py = pybind11;
void regclass_pyngraph_Node(py::module m)
{
py::class_<ngraph::Node, std::shared_ptr<ngraph::Node>> node(m, "Node");
node.doc() = "ngraph.Node wraps ngraph::Node";
node.def("__add__",
[](const std::shared_ptr<ngraph::Node>& a, const std::shared_ptr<ngraph::Node> b) {
return a + b;
},
py::is_operator());
node.def("__sub__",
[](const std::shared_ptr<ngraph::Node>& a, const std::shared_ptr<ngraph::Node> b) {
return a - b;
},
py::is_operator());
node.def("__mul__",
[](const std::shared_ptr<ngraph::Node>& a, const std::shared_ptr<ngraph::Node> b) {
return a * b;
},
py::is_operator());
node.def("__div__",
[](const std::shared_ptr<ngraph::Node>& a, const std::shared_ptr<ngraph::Node> b) {
return a / b;
},
py::is_operator());
node.def("__truediv__",
[](const std::shared_ptr<ngraph::Node>& a, const std::shared_ptr<ngraph::Node> b) {
return a / b;
},
py::is_operator());
node.def("__repr__", [](const ngraph::Node& self) {
std::string class_name = py::cast(self).get_type().attr("__name__").cast<std::string>();
std::string shape = py::cast(self.get_shape()).attr("__str__")().cast<std::string>();
return "<" + class_name + ": '" + self.get_name() + "' (" + shape + ")>";
});
node.def("get_output_size", &ngraph::Node::get_output_size);
node.def("get_output_element_type", &ngraph::Node::get_output_element_type);
node.def("get_element_type", &ngraph::Node::get_element_type);
node.def("get_output_shape", &ngraph::Node::get_output_shape);
node.def("get_shape", &ngraph::Node::get_shape);
node.def("get_input_op", &ngraph::Node::get_input_op);
node.def_property("name", &ngraph::Node::get_name, &ngraph::Node::set_name);
node.def_property_readonly("shape", &ngraph::Node::get_shape);
}
/*******************************************************************************
* Copyright 2017-2018 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_Node(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/node.hpp" // ngraph::Node
#include "ngraph/node_vector.hpp"
#include "pyngraph/node.hpp"
#include "pyngraph/node_vector.hpp"
namespace py = pybind11;
void regclass_pyngraph_NodeVector(py::module m)
{
py::class_<ngraph::NodeVector, std::shared_ptr<ngraph::NodeVector>> node_vector(m,
"NodeVector");
node_vector.doc() = "ngraph.NodeVector wraps ngraph::NodeVector";
node_vector.def(py::init<const std::initializer_list<std::shared_ptr<ngraph::Node>>&>());
node_vector.def(py::init<const std::vector<std::shared_ptr<ngraph::Node>>&>());
node_vector.def(py::init<const ngraph::NodeVector&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_NodeVector(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/abs.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/abs.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Abs(py::module m)
{
py::class_<ngraph::op::Abs,
std::shared_ptr<ngraph::op::Abs>,
ngraph::op::util::UnaryElementwiseArithmetic>
abs(m, "Abs");
abs.doc() = "ngraph.op.Abs wraps ngraph::op::Abs";
abs.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Abs(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/acos.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/acos.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Acos(py::module m)
{
py::class_<ngraph::op::Acos,
std::shared_ptr<ngraph::op::Acos>,
ngraph::op::util::UnaryElementwiseArithmetic>
acos(m, "Acos");
acos.doc() = "ngraph.op.Acos wraps ngraph::op::Acos";
acos.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Acos(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/add.hpp" // ngraph::op::Add
#include "pyngraph/ops/add.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Add(py::module m)
{
py::class_<ngraph::op::Add,
std::shared_ptr<ngraph::op::Add>,
ngraph::op::util::BinaryElementwiseArithmetic>
add(m, "Add");
add.doc() = "ngraph.op.Add wraps ngraph::op::Add";
add.def(py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Add(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/allreduce.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/allreduce.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_AllReduce(py::module m)
{
py::class_<ngraph::op::AllReduce,
std::shared_ptr<ngraph::op::AllReduce>,
ngraph::op::util::RequiresTensorViewArgs>
allreduce(m, "AllReduce");
allreduce.doc() = "ngraph.op.AllReduce wraps ngraph::op::AllReduce";
allreduce.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_AllReduce(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/asin.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/asin.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Asin(py::module m)
{
py::class_<ngraph::op::Asin,
std::shared_ptr<ngraph::op::Asin>,
ngraph::op::util::UnaryElementwiseArithmetic>
asin(m, "Asin");
asin.doc() = "ngraph.op.Asin wraps ngraph::op::Asin";
asin.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Asin(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/atan.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/atan.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Atan(py::module m)
{
py::class_<ngraph::op::Atan,
std::shared_ptr<ngraph::op::Atan>,
ngraph::op::util::UnaryElementwiseArithmetic>
atan(m, "Atan");
atan.doc() = "ngraph.op.Atan wraps ngraph::op::Atan";
atan.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Atan(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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/ops/avg_pool.hpp"
#include "ngraph/shape.hpp"
#include "pyngraph/ops/avg_pool.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_AvgPool(py::module m)
{
py::class_<ngraph::op::AvgPool,
std::shared_ptr<ngraph::op::AvgPool>,
ngraph::op::util::RequiresTensorViewArgs>
avg_pool(m, "AvgPool");
avg_pool.doc() = "ngraph.op.AvgPool wraps ngraph::op::AvgPool";
avg_pool.def(py::init<const std::shared_ptr<ngraph::Node>&,
const ngraph::Shape&,
const ngraph::Strides&,
const ngraph::Shape&,
const ngraph::Shape&,
bool>());
avg_pool.def(py::init<const std::shared_ptr<ngraph::Node>&,
const ngraph::Shape&,
const ngraph::Strides&>());
avg_pool.def(py::init<const std::shared_ptr<ngraph::Node>&, const ngraph::Shape&>());
}
void regclass_pyngraph_op_AvgPoolBackprop(py::module m)
{
py::class_<ngraph::op::AvgPoolBackprop,
std::shared_ptr<ngraph::op::AvgPoolBackprop>,
ngraph::op::util::RequiresTensorViewArgs>
avg_pool_backprop(m, "AvgPoolBackprop");
avg_pool_backprop.doc() = "ngraph.op.AvgPoolBackprop wraps ngraph::op::AvgPoolBackprop";
avg_pool_backprop.def(py::init<const ngraph::Shape&,
const std::shared_ptr<ngraph::Node>&,
const ngraph::Shape&,
const ngraph::Strides&,
const ngraph::Shape&,
const ngraph::Shape&,
bool>());
}
/*******************************************************************************
* Copyright 2017-2018 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_AvgPool(py::module m);
void regclass_pyngraph_op_AvgPoolBackprop(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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/ops/batch_norm.hpp"
#include "pyngraph/ops/batch_norm.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_BatchNorm(py::module m)
{
py::class_<ngraph::op::BatchNorm,
std::shared_ptr<ngraph::op::BatchNorm>,
ngraph::op::util::RequiresTensorViewArgs>
batch_norm(m, "BatchNorm");
batch_norm.doc() = "ngraph.op.BatchNorm wraps ngraph::op::BatchNorm";
batch_norm.def(py::init<double,
const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&>());
}
void regclass_pyngraph_op_BatchNormBackprop(py::module m)
{
py::class_<ngraph::op::BatchNormBackprop,
std::shared_ptr<ngraph::op::BatchNormBackprop>,
ngraph::op::util::RequiresTensorViewArgs>
batch_norm_backprop(m, "BatchNormBackprop");
batch_norm_backprop.doc() = "ngraph.op.BatchNormBackprop wraps ngraph::op::BatchNormBackprop";
batch_norm_backprop.def(py::init<double,
const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_BatchNorm(py::module m);
void regclass_pyngraph_op_BatchNormBackprop(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/broadcast.hpp"
#include "ngraph/shape.hpp"
#include "pyngraph/ops/broadcast.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Broadcast(py::module m)
{
py::class_<ngraph::op::Broadcast,
std::shared_ptr<ngraph::op::Broadcast>,
ngraph::op::util::RequiresTensorViewArgs>
broadcast(m, "Broadcast");
broadcast.doc() = "ngraph.op.Broadcast wraps ngraph::op::Broadcast";
broadcast.def(py::init<const std::shared_ptr<ngraph::Node>&,
const ngraph::Shape&,
const ngraph::AxisSet&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Broadcast(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/ceiling.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/ceiling.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Ceiling(py::module m)
{
py::class_<ngraph::op::Ceiling,
std::shared_ptr<ngraph::op::Ceiling>,
ngraph::op::util::UnaryElementwiseArithmetic>
ceiling(m, "Ceiling");
ceiling.doc() = "ngraph.op.Ceiling wraps ngraph::op::Ceiling";
ceiling.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Ceiling(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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/ops/concat.hpp"
#include "ngraph/shape.hpp"
#include "pyngraph/ops/concat.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Concat(py::module m)
{
py::class_<ngraph::op::Concat,
std::shared_ptr<ngraph::op::Concat>,
ngraph::op::util::RequiresTensorViewArgs>
concat(m, "Concat");
concat.doc() = "ngraph.op.Concat wraps ngraph::op::Concat";
concat.def(py::init<const ngraph::NodeVector&, size_t>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Concat(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/constant.hpp"
#include "pyngraph/ops/constant.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Constant(py::module m)
{
py::class_<ngraph::op::Constant, std::shared_ptr<ngraph::op::Constant>, ngraph::Node> constant(
m, "Constant");
constant.doc() = "ngraph.op.Constant wraps ngraph::op::Constant";
constant.def(
py::init<const ngraph::element::Type&, const ngraph::Shape&, const std::vector<char>&>());
constant.def(
py::init<const ngraph::element::Type&, const ngraph::Shape&, const std::vector<float>&>());
constant.def(
py::init<const ngraph::element::Type&, const ngraph::Shape&, const std::vector<double>&>());
constant.def(
py::init<const ngraph::element::Type&, const ngraph::Shape&, const std::vector<int8_t>&>());
constant.def(py::init<const ngraph::element::Type&,
const ngraph::Shape&,
const std::vector<int16_t>&>());
constant.def(py::init<const ngraph::element::Type&,
const ngraph::Shape&,
const std::vector<int32_t>&>());
constant.def(py::init<const ngraph::element::Type&,
const ngraph::Shape&,
const std::vector<int64_t>&>());
constant.def(py::init<const ngraph::element::Type&,
const ngraph::Shape&,
const std::vector<uint8_t>&>());
constant.def(py::init<const ngraph::element::Type&,
const ngraph::Shape&,
const std::vector<uint16_t>&>());
constant.def(py::init<const ngraph::element::Type&,
const ngraph::Shape&,
const std::vector<uint32_t>&>());
constant.def(py::init<const ngraph::element::Type&,
const ngraph::Shape&,
const std::vector<uint64_t>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Constant(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/convert.hpp"
#include "pyngraph/ops/convert.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Convert(py::module m)
{
py::class_<ngraph::op::Convert,
std::shared_ptr<ngraph::op::Convert>,
ngraph::op::util::UnaryElementwise>
convert(m, "Convert");
convert.doc() = "ngraph.op.Convert wraps ngraph::op::Convert";
convert.def(py::init<const std::shared_ptr<ngraph::Node>&, const ngraph::element::Type&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Convert(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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/ops/convolution.hpp"
#include "ngraph/shape.hpp"
#include "pyngraph/ops/convolution.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Convolution(py::module m)
{
py::class_<ngraph::op::Convolution,
std::shared_ptr<ngraph::op::Convolution>,
ngraph::op::util::RequiresTensorViewArgs>
convolution(m, "Convolution");
convolution.doc() = "ngraph.op.Convolution wraps ngraph::op::Convolution";
convolution.def(py::init<const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const ngraph::Strides&,
const ngraph::Strides&,
const ngraph::CoordinateDiff&,
const ngraph::CoordinateDiff&,
const ngraph::Strides&>());
convolution.def(py::init<const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const ngraph::Strides&,
const ngraph::Strides&,
const ngraph::CoordinateDiff&,
const ngraph::CoordinateDiff&>());
convolution.def(py::init<const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const ngraph::Strides&,
const ngraph::Strides&>());
convolution.def(py::init<const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const ngraph::Strides&>());
convolution.def(
py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
}
void regclass_pyngraph_op_ConvolutionBackpropData(py::module m)
{
py::class_<ngraph::op::ConvolutionBackpropData,
std::shared_ptr<ngraph::op::ConvolutionBackpropData>,
ngraph::op::util::RequiresTensorViewArgs>
convolutionBackpropData(m, "ConvolutionBackpropData");
convolutionBackpropData.def(py::init<const ngraph::Shape&,
const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const ngraph::Strides&,
const ngraph::Strides&,
const ngraph::CoordinateDiff&,
const ngraph::CoordinateDiff&,
const ngraph::Strides&>());
}
void regclass_pyngraph_op_ConvolutionBackpropFilters(py::module m)
{
py::class_<ngraph::op::ConvolutionBackpropFilters,
std::shared_ptr<ngraph::op::ConvolutionBackpropFilters>,
ngraph::op::util::RequiresTensorViewArgs>
convolutionBackpropFilters(m, "ConvolutionBackpropFilters");
convolutionBackpropFilters.def(py::init<const std::shared_ptr<ngraph::Node>&,
const ngraph::Shape&,
const std::shared_ptr<ngraph::Node>&,
const ngraph::Strides&,
const ngraph::Strides&,
const ngraph::CoordinateDiff&,
const ngraph::CoordinateDiff&,
const ngraph::Strides&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Convolution(py::module m);
void regclass_pyngraph_op_ConvolutionBackpropData(py::module m);
void regclass_pyngraph_op_ConvolutionBackpropFilters(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/cos.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/cos.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Cos(py::module m)
{
py::class_<ngraph::op::Cos,
std::shared_ptr<ngraph::op::Cos>,
ngraph::op::util::UnaryElementwiseArithmetic>
cos(m, "Cos");
cos.doc() = "ngraph.op.Cos wraps ngraph::op::Cos";
cos.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Cos(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/cosh.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/cosh.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Cosh(py::module m)
{
py::class_<ngraph::op::Cosh,
std::shared_ptr<ngraph::op::Cosh>,
ngraph::op::util::UnaryElementwiseArithmetic>
cosh(m, "Cosh");
cosh.doc() = "ngraph.op.Cosh wraps ngraph::op::Cosh";
cosh.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Cosh(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/divide.hpp"
#include "pyngraph/ops/divide.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Divide(py::module m)
{
py::class_<ngraph::op::Divide,
std::shared_ptr<ngraph::op::Divide>,
ngraph::op::util::BinaryElementwiseArithmetic>
divide(m, "Divide");
divide.doc() = "ngraph.op.Divide wraps ngraph::op::Divide";
divide.def(
py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Divide(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/dot.hpp"
#include "pyngraph/ops/dot.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Dot(py::module m)
{
py::class_<ngraph::op::Dot,
std::shared_ptr<ngraph::op::Dot>,
ngraph::op::util::RequiresTensorViewArgs>
dot(m, "Dot");
dot.doc() = "ngraph.op.Dot wraps ngraph::op::Dot";
dot.def(py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
dot.def(py::init<const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
size_t>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Dot(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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/ops/equal.hpp"
#include "pyngraph/ops/equal.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Equal(py::module m)
{
py::class_<ngraph::op::Equal,
std::shared_ptr<ngraph::op::Equal>,
ngraph::op::util::BinaryElementwiseComparison>
equal(m, "Equal");
equal.doc() = "ngraph.op.Equal wraps ngraph::op::Equal";
equal.def(
py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Equal(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/exp.hpp"
#include "pyngraph/ops/exp.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Exp(py::module m)
{
py::class_<ngraph::op::Exp,
std::shared_ptr<ngraph::op::Exp>,
ngraph::op::util::UnaryElementwiseArithmetic>
exp(m, "Exp");
exp.doc() = "ngraph.op.Exp wraps ngraph::op::Exp";
exp.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Exp(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/floor.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/floor.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Floor(py::module m)
{
py::class_<ngraph::op::Floor,
std::shared_ptr<ngraph::op::Floor>,
ngraph::op::util::UnaryElementwiseArithmetic>
floor(m, "Floor");
floor.doc() = "ngraph.op.Floor wraps ngraph::op::Floor";
floor.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Floor(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/function_call.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "ngraph/function.hpp"
#include "pyngraph/ops/function_call.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_FunctionCall(py::module m)
{
py::class_<ngraph::op::FunctionCall, std::shared_ptr<ngraph::op::FunctionCall>, ngraph::Node>
function_call(m, "FunctionCall");
function_call.doc() = "ngraph.op.FunctionCall wraps ngraph::op::FunctionCall";
function_call.def(py::init<std::shared_ptr<ngraph::Function>, const ngraph::NodeVector&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_FunctionCall(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/get_output_element.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/get_output_element.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_GetOutputElement(py::module m)
{
py::class_<ngraph::op::GetOutputElement,
std::shared_ptr<ngraph::op::GetOutputElement>,
ngraph::Node>
get_output_element(m, "GetOutputElement");
get_output_element.doc() = "ngraph.op.GetOutputElement wraps ngraph::op::GetOutputElement";
get_output_element.def(py::init<const std::shared_ptr<ngraph::Node>&, size_t>());
}
/*******************************************************************************
* Copyright 2017-2018 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_GetOutputElement(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/greater.hpp"
#include "pyngraph/ops/greater.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Greater(py::module m)
{
py::class_<ngraph::op::Greater,
std::shared_ptr<ngraph::op::Greater>,
ngraph::op::util::BinaryElementwiseComparison>
greater(m, "Greater");
greater.doc() = "ngraph.op.Greater wraps ngraph::op::Greater";
greater.def(
py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Greater(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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/ops/greater_eq.hpp"
#include "pyngraph/ops/greater_eq.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_GreaterEq(py::module m)
{
py::class_<ngraph::op::GreaterEq,
std::shared_ptr<ngraph::op::GreaterEq>,
ngraph::op::util::BinaryElementwiseComparison>
greater_eq(m, "GreaterEq");
greater_eq.doc() = "ngraph.op.GreaterEq wraps ngraph::op::GreaterEq";
greater_eq.def(
py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_GreaterEq(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/less.hpp"
#include "pyngraph/ops/less.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Less(py::module m)
{
py::class_<ngraph::op::Less,
std::shared_ptr<ngraph::op::Less>,
ngraph::op::util::BinaryElementwiseComparison>
less(m, "Less");
less.doc() = "ngraph.op.Less wraps ngraph::op::Less";
less.def(
py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Less(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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/ops/less_eq.hpp"
#include "pyngraph/ops/less_eq.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_LessEq(py::module m)
{
py::class_<ngraph::op::LessEq,
std::shared_ptr<ngraph::op::LessEq>,
ngraph::op::util::BinaryElementwiseComparison>
less_eq(m, "LessEq");
less_eq.doc() = "ngraph.op.LessEq wraps ngraph::op::LessEq";
less_eq.def(
py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_LessEq(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/log.hpp"
#include "pyngraph/ops/log.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Log(py::module m)
{
py::class_<ngraph::op::Log,
std::shared_ptr<ngraph::op::Log>,
ngraph::op::util::UnaryElementwiseArithmetic>
log(m, "Log");
log.doc() = "ngraph.op.Log wraps ngraph::op::Log";
log.def(py::init<const std::shared_ptr<ngraph::Node>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Log(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 "ngraph/ops/max.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "pyngraph/ops/max.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Max(py::module m)
{
py::class_<ngraph::op::Max,
std::shared_ptr<ngraph::op::Max>,
ngraph::op::util::ArithmeticReduction>
max(m, "Max");
max.doc() = "ngraph.op.Max wraps ngraph::op::Max";
max.def(py::init<const std::shared_ptr<ngraph::Node>&, const ngraph::AxisSet&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_Max(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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/ops/max_pool.hpp"
#include "ngraph/shape.hpp"
#include "pyngraph/ops/max_pool.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_MaxPool(py::module m)
{
py::class_<ngraph::op::MaxPool,
std::shared_ptr<ngraph::op::MaxPool>,
ngraph::op::util::RequiresTensorViewArgs>
max_pool(m, "MaxPool");
max_pool.def(py::init<const std::shared_ptr<ngraph::Node>&,
const ngraph::Shape&,
const ngraph::Strides&,
const ngraph::Shape&,
const ngraph::Shape&>());
max_pool.def(py::init<const std::shared_ptr<ngraph::Node>&,
const ngraph::Shape&,
const ngraph::Strides&>());
max_pool.def(py::init<const std::shared_ptr<ngraph::Node>&, const ngraph::Shape&>());
}
void regclass_pyngraph_op_MaxPoolBackprop(py::module m)
{
py::class_<ngraph::op::MaxPoolBackprop,
std::shared_ptr<ngraph::op::MaxPoolBackprop>,
ngraph::op::util::RequiresTensorViewArgs>
max_pool_backprop(m, "MaxPoolBackprop");
max_pool_backprop.doc() = "ngraph.op.MaxPoolBackprop wraps ngraph::op::MaxPoolBackprop";
max_pool_backprop.def(py::init<const std::shared_ptr<ngraph::Node>&,
const std::shared_ptr<ngraph::Node>&,
const ngraph::Shape&,
const ngraph::Strides&,
const ngraph::Shape&,
const ngraph::Shape&,
const std::shared_ptr<ngraph::op::MaxPool>&>());
}
/*******************************************************************************
* Copyright 2017-2018 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_MaxPool(py::module m);
void regclass_pyngraph_op_MaxPoolBackprop(py::module m);
/*******************************************************************************
* Copyright 2017-2018 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 <string>
#include "ngraph/ops/maximum.hpp"
#include "pyngraph/ops/maximum.hpp"
namespace py = pybind11;
void regclass_pyngraph_op_Maximum(py::module m)
{
py::class_<ngraph::op::Maximum,
std::shared_ptr<ngraph::op::Maximum>,
ngraph::op::util::BinaryElementwiseArithmetic>
maximum(m, "Maximum");
maximum.doc() = "ngraph.op.Maximum wraps ngraph::op::Maximum";
maximum.def(
py::init<const std::shared_ptr<ngraph::Node>&, const std::shared_ptr<ngraph::Node>&>());
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment