Commit 7f01651c authored by pthoreho's avatar pthoreho

Merge branch 'jbobba/batchnorm-layout' into pruthvi/mkldnn_elementwise_add

parents f029ab3e 1c96c45c
......@@ -48,6 +48,7 @@ output/
*.mpg
*.cpio
*.wav
*.backup
doc/source/generated
.cache/
nervana_aeon.egg-info/
......
......@@ -10,7 +10,7 @@
+ `RequiresTensorViewArgs`
+ `UnaryElementwiseArithmetic`
+ `UnaryElementwise`
Ops defined outside of nGraph core will need to get the base class from `ngraph::op::util` and
Ops defined outside of nGraph core will need to get the base class from `ngraph::op::util` and
change the include file to `#include "ngraph/ops/util/requires_tensor_view_args.hpp"`, etc.
See any of the core ops for an example.
......@@ -28,6 +28,11 @@
All of the above information can be inferred from the shapes and parameters of the op.
* The `AvgPool` operator has a new attribute governing whether or not padding-region values
are considered when computing a given window's average: `include_padding_in_avg_computation`.
One of the class constructors adds this to the parameter list, and the others use a default
value of `false` which matches the old behavior.
## Negative convolution padding
`Convolution` now allows negative padding. This means that the `padding_below` and `padding_above`
......
# Environment to build and unit-test private-ngraph-cpp on centos74
# with gcc 4.8.5
# with python 2.7
# with cmake3
# LLVM/clang will be built from source
FROM centos:7
# Added install for perl Data::Dumper to avoid a compile error
RUN yum -y update && \
yum -y --enablerepo=extras install epel-release && \
yum -y install \
gcc gcc-c++ \
cmake3 make \
git \
wget patch diffutils zlib-devel ncurses-devel libtinfo-dev \
python python-devel python-setuptools \
doxygen \
which \
'perl(Data::Dumper)'
RUN ln -s /usr/bin/cmake3 /usr/bin/cmake
RUN cmake --version
RUN make --version
RUN gcc --version
RUN c++ --version
RUN easy_install pip
RUN pip install virtualenv
# Install some pip packages
RUN pip install numpy
# need to use sphinx version 1.6 to build docs
# installing with apt-get install python-sphinx installs sphinx version 1.3.6 only
# added install for python-pip above and
# installed sphinx with pip to get the updated version 1.6.5
# allows for make html build under the doc/source directory as an interim build process
RUN pip install sphinx
# breathe package required to build documentation
RUN pip install breathe
WORKDIR /home
# Environment to build and unit-test private-ngraph-cpp
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
build-essential cmake \
clang-3.9 clang-format-3.9 \
git \
wget patch diffutils zlib1g-dev libtinfo-dev \
doxygen python-pip
RUN apt-get clean autoclean && \
apt-get autoremove -y
RUN pip install --upgrade pip
# need to use sphinx version 1.6 to build docs
# installing with apt-get install python-sphinx installs sphinx version 1.3.6 only
# added install for python-pip above and
# installed sphinx with pip to get the updated version 1.6.5
# allows for make html build under the doc/source directory as an interim build process
RUN pip install sphinx
RUN pip install breathe
WORKDIR /home
# Environment to build and unit-test private-ngraph-cpp
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
build-essential cmake \
git \
wget patch diffutils zlib1g-dev libtinfo-dev \
doxygen python-pip
RUN which gcc && gcc --version || true
RUN which cc++ && cc++ --version || true
RUN apt-get install -y gcc-4.8 gcc++-4.8
RUN which gcc && gcc --version || true
RUN which cc++ && cc++ --version || true
RUN ln -s /usr/bin/gcc-4.8 /usr/bin/gcc || true
RUN ln -s /usr/bin/cc++-4.8 /usr/bin/cc++ || true
RUN which gcc && gcc --version || true
RUN which cc++ && cc++ --version || true
#RUN apt-get clean autoclean && \
# apt-get autoremove -y
RUN pip install --upgrade pip
# need to use sphinx version 1.6 to build docs
# installing with apt-get install python-sphinx installs sphinx version 1.3.6 only
# added install for python-pip above and
# installed sphinx with pip to get the updated version 1.6.5
# allows for make html build under the doc/source directory as an interim build process
RUN pip install sphinx
# breathe package required to build documentation
RUN pip install breathe
WORKDIR /home
# Basic Makefile for contrib/docker. This can be expanded later as more targets
# are added.
# Default is to build with -j for parallel builds. Turn off with
# make PARELLEL=
# Default is to build with -j for parallel cmake/make. Turn off with
# make PARALLEL=
PARALLEL=-j
# DIR is an internal variable that serves as an anchor to this cloned git
......@@ -28,13 +28,27 @@ DBUILD_DIR = ${DIR}/contrib/docker/.build-${DBUILD_VERSION}
# Enable additional options to be added on the command line
ifndef CMAKE_OPTIONS_EXTRA
CMAKE_OPTIONS_EXTRA = ""
CMAKE_OPTIONS_EXTRA=
endif
# OS set to 'ubuntu1604' by default
# can be overridden on the command line with 'make <target> OS=centos74"
ifndef OS
OS="ubuntu1604"
endif
ifeq ("$(shell echo ${OS} | grep centos)","centos74")
RUN_AS_USER_SCRIPT=${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_centos_user.sh
DOCKERFILE=Dockerfile.ngraph_cpp.centos74_cmake3
else
DOCKERFILE ?= "Dockerfile.ngraph_cpp"
RUN_AS_USER_SCRIPT ?= ${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_ubuntu_user.sh
endif
# For gcc builds, we do NOT regard warnings as errors
# For clang builds, we DO make warnings into errors
CMAKE_OPTIONS_COMMON=-DNGRAPH_BUILD_DOXYGEN_DOCS=ON -DNGRAPH_BUILD_SPHINX_DOCS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo $(CMAKE_OPTIONS_EXTRA)
CMAKE_OPTIONS_GCC=$(CMAKE_OPTIONS_COMMON) -DNGRAPH_INSTALL_PREFIX=${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC/ngraph_dist -DNGRAPH_USE_PREBUILT_LLVM=TRUE
CMAKE_OPTIONS_GCC=$(CMAKE_OPTIONS_COMMON) -DNGRAPH_INSTALL_PREFIX=${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC/ngraph_dist
CMAKE_OPTIONS_CLANG=$(MAKE_OPTIONS_COMMON)-DNGRAPH_INSTALL_PREFIX=${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG/ngraph_dist -DCMAKE_CXX_COMPILER=clang++-3.9 -DCMAKE_C_COMPILER=clang-3.9 -DNGRAPH_WARNINGS_AS_ERRORS=ON -DNGRAPH_USE_PREBUILT_LLVM=TRUE
CALLER_UID := $(shell id -u)
......@@ -66,9 +80,12 @@ all: check_gcc check_clang
# Docker actions
expand_dockerfile_templates:
@echo "OS=${OS}"
@echo "DOCKERFILE=${DOCKERFILE}"
@echo "RUN_AS_USER_SCRIPT=${RUN_AS_USER_SCRIPT}"
cd "${DIR}"/contrib/docker
mkdir "${DBUILD_DIR}" || true
sed -e 's/\(FROM ngraph.*\)/\1:${DBUILD_VERSION}/' Dockerfile.ngraph_cpp > "${DBUILD_DIR}"/Dockerfile.build_ngraph_cpp
sed -e 's/\(FROM ngraph.*\)/\1:${DBUILD_VERSION}/' ${DOCKERFILE} > "${DBUILD_DIR}"/Dockerfile.build_ngraph_cpp
build_docker_image: expand_dockerfile_templates
$(DOCKER_BUILD) -f="${DBUILD_DIR}"/Dockerfile.build_ngraph_cpp --build-arg python_version="${PYTHON_VERSION}" -t=build_ngraph_cpp:"${DBUILD_VERSION}" .
......@@ -85,11 +102,11 @@ sphinx_doc: build_docker_image
# sphinx html docs build
docker run --rm --tty \
${VOLUME} \
${DOCKER_RUN_ENV} \
{DOCKER_RUN_ENV} \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/doc/sphinx; env VERBOSE=1 make html 2>&1 | tee make_sphinx_html.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
sh -c "${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_user.sh"
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Build
build_all: build_gcc build_clang
......@@ -105,11 +122,11 @@ build_gcc: build_docker_image
${DOCKER_RUN_ENV} \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC/unit-test-results.xml" \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC; cmake ${CMAKE_OPTIONS_GCC} .. 2>&1 | tee cmake_gcc.log ; env VERBOSE=1 make ${PARALLEL} 2>&1 | tee make_gcc.log" \
--env RUN_CMD="set -x; set -e ; set -o pipefail ; if [ -f "/etc/centos-release" ]; then cat /etc/centos-release; fi; if [ -f "/etc/lsb-release" ]; then cat /etc/lsb-release; fi; uname -a ; cat /etc/os-release || true; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC; cmake ${CMAKE_OPTIONS_GCC} .. 2>&1 | tee cmake_gcc.log ; env VERBOSE=1 make ${PARALLEL} 2>&1 | tee make_gcc.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
sh -c "${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_user.sh"
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
build_clang:
build_clang: build_docker_image
# Remove old distribution directory if present
( test -d "${DIR}"/BUILD-CLANG/ngraph_dist && rm -fr "${DIR}"/BUILD-CLANG/ngraph_dist && echo "Removed old ${DIR}/BUILD-CLANG/ngraph_dist directory" ) || echo "Previous ngraph_dist directory not found"
# Make BUILD-CLANG directory as user
......@@ -120,9 +137,9 @@ build_clang:
${DOCKER_RUN_ENV} \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG/unit-test-results.xml" \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG; cmake ${CMAKE_OPTIONS_CLANG} .. 2>&1 | tee cmake_clang.log ; env VERBOSE=1 make ${PARALLEL} 2>&1 | tee make_clang.log" \
--env RUN_CMD="set -e ; set -o pipefail ; if [ -f "/etc/centos-release" ]; then cat /etc/centos-release; fi; if [ -f "/etc/lsb-release" ]; then cat /etc/lsb-release; fi; uname -a ; cat /etc/os-release || true; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG; cmake ${CMAKE_OPTIONS_CLANG} .. 2>&1 | tee cmake_clang.log ; env VERBOSE=1 make ${PARALLEL} 2>&1 | tee make_clang.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
sh -c "${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_user.sh"
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Check (run unit-tests)
......@@ -134,9 +151,9 @@ check_gcc: build_gcc
${DOCKER_RUN_ENV} \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC/unit-test-results.xml" \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC; env VERBOSE=1 make check 2>&1 | tee make_check_gcc.log ; sed -E -e 's/classname\=\"[a-zA-Z0-9_]+/&1_gcc/' unit-test-results.xml > unit-test-results-gcc.xml" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC; env VERBOSE=1 make unit-test-check 2>&1 | tee make_check_gcc.log ; sed -E -e 's/classname\=\"[a-zA-Z0-9_]+/&1_gcc/' unit-test-results.xml > unit-test-results-gcc.xml" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
sh -c "${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_user.sh"
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
check_clang: build_clang
docker run --rm --tty \
......@@ -146,7 +163,17 @@ check_clang: build_clang
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG; env VERBOSE=1 make check 2>&1 | tee make_check_clang.log ; sed -E -e 's/classname\=\"[a-zA-Z0-9_]+/&1_clang/' unit-test-results.xml > unit-test-results-clang.xml" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
sh -c "${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_user.sh"
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
style_clang: build_clang
docker run --rm --tty \
${VOLUME} \
${DOCKER_RUN_ENV} \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG/unit-test-results.xml" \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG; env VERBOSE=1 make style-check 2>&1 | tee make_style_check_clang.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Install
......@@ -160,7 +187,7 @@ install_gcc: check_gcc
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC ; test -d ngraph_dist && rm -fr ngraph_dist && echo 'Removed old ngraph_dist directory' ; make install 2>&1 | tee make_install_gcc.log ; tar czf ngraph_dist_gcc.tgz ngraph_dist 2>&1 | tee make_tarball_gcc.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
sh -c "${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_user.sh"
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
install_clang: check_clang
# Puts ngraph_dist in BUILD-CLANG directory. This is used by Jenkins ngraph-tensorflow batch job.
......@@ -170,7 +197,7 @@ install_clang: check_clang
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG ; test -d ngraph_dist && rm -fr ngraph_dist && echo 'Removed old ngraph_dist directory' ; make install 2>&1 | tee make_install_clang.log ; tar czf ngraph_dist_clang.tgz ngraph_dist 2>&1 | tee make_tarball_clang.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
sh -c "${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_user.sh"
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Interactive shell
......@@ -181,7 +208,7 @@ shell: build_docker_image
${DOCKER_RUN_ENV} \
--env RUN_UID="$(shell id -u)" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME} ; ${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_user.sh"
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Clean
......
#! /bin/bash
# This script is designed to simulate running as a user with a particular UID
# within a docker container.
#
# Normally a docker container runs as root, which can cause problems with file
# ownership when a host directory tree is mounted into the docker container.
# There are other problems with building and running software as root as
# well. Good practice when validating software builds in a docker container
# is to run as a normal user, since many (most?) end users will not be building
# and installing software as root.
#
# This script should be run using "docker run", with RUN_UID (set to the user
# you want to run as) passed into the docker container as an environment
# variable. The script will then add the UID as user "dockuser" to
# /etc/passwd (important for some software, like bazel), add the new dockuser
# to the sudo group (whether or not sudo is installed), and su to a new shell
# as the dockuser (passing in the existing environment, which is important).
#
# If the environment variable RUN_CMD is passed into the docker container, then
# this script will use RUN_CMD as a command to run when su'ing. If RUN_CMD is
# not defined, then /bin/bash will run, which effectively provides an
# interactive shell in the docker container, for debugging.
set -e # Make sure we exit on any command that returns non-zero
set -u # No unset variables
if [ -z "$RUN_UID" ] ; then
# >&2 redirects echo output to stderr.
# See: https://stackoverflow.com/questions/2990414/echo-that-outputs-to-stderr
( >&2 echo 'ERROR: Environment variable RUN_UID was not set when run-as-user.sh was run' )
( >&2 echo ' Running as default user (root, in docker)' )
( >&2 echo ' ' )
exit 1
else
# The username used in the docker container to map the caller UID to
#
# Note 'dockuser' is used in other scripts, notably Makefile. If you
# choose to change it here, then you need to change it in all other
# scripts, or else the builds will break.
#
DOCK_USER='dockuser'
# We will be su'ing using a non-login shell or command, and preserving
# the environment. This is done so that env. variables passed in with
# "docker run --env ..." are honored.
# Therefore, we need to reset at least HOME=/root ...
#
# Note also that /home/dockuser is used in other scripts, notably
# Makefile. If you choose to change it here, then you need to change it
# in all other scripts, or else the builds will break.
#
export HOME="/home/${DOCK_USER}"
# Make sure the home directory is owned by the new user
if [ -d "${HOME}" ] ; then
chown "${RUN_UID}" "${HOME}"
fi
# Add a user with UID of person running docker (in ${RUN_UID})
# If $HOME does not yet exist, then it will be created
adduser -c 'Docker-User' -u "${RUN_UID}" "${DOCK_USER}"
passwd -d "${DOCK_USER}"
# Add dockuser to the sudo group. Sudo *is* used for installing packages,
# so make sure dockuser can run sudo without requesting a password.
usermod -aG wheel "${DOCK_USER}"
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
if [ -z "${RUN_CMD+x}" ] ; then # Launch a shell as dockuser
echo 'Running interactive shell (/bin/bash) as dockuser'
su -m "${DOCK_USER}" -c "/bin/bash"
else # Run command as dockuser
echo "Running command [${RUN_CMD}] as dockuser"
su -m "${DOCK_USER}" -c "${RUN_CMD}"
fi
fi
#! /bin/bash
# This script is designed to simulate running as a user with a particular UID
# within a docker container.
#
# Normally a docker container runs as root, which can cause problems with file
# ownership when a host directory tree is mounted into the docker container.
# There are other problems with building and running software as root as
# well. Good practice when validating software builds in a docker container
# is to run as a normal user, since many (most?) end users will not be building
# and installing software as root.
#
# This script should be run using "docker run", with RUN_UID (set to the user
# you want to run as) passed into the docker container as an environment
# variable. The script will then add the UID as user "dockuser" to
# /etc/passwd (important for some software, like bazel), add the new dockuser
# to the sudo group (whether or not sudo is installed), and su to a new shell
# as the dockuser (passing in the existing environment, which is important).
#
# If the environment variable RUN_CMD is passed into the docker container, then
# this script will use RUN_CMD as a command to run when su'ing. If RUN_CMD is
# not defined, then /bin/bash will run, which effectively provides an
# interactive shell in the docker container, for debugging.
set -e # Make sure we exit on any command that returns non-zero
set -u # No unset variables
if [ -z "$RUN_UID" ] ; then
# >&2 redirects echo output to stderr.
# See: https://stackoverflow.com/questions/2990414/echo-that-outputs-to-stderr
( >&2 echo 'ERROR: Environment variable RUN_UID was not set when run-as-user.sh was run' )
( >&2 echo ' Running as default user (root, in docker)' )
( >&2 echo ' ' )
exit 1
else
# The username used in the docker container to map the caller UID to
#
# Note 'dockuser' is used in other scripts, notably Makefile. If you
# choose to change it here, then you need to change it in all other
# scripts, or else the builds will break.
#
DOCK_USER='dockuser'
# We will be su'ing using a non-login shell or command, and preserving
# the environment. This is done so that env. variables passed in with
# "docker run --env ..." are honored.
# Therefore, we need to reset at least HOME=/root ...
#
# Note also that /home/dockuser is used in other scripts, notably
# Makefile. If you choose to change it here, then you need to change it
# in all other scripts, or else the builds will break.
#
export HOME="/home/${DOCK_USER}"
# Make sure the home directory is owned by the new user
if [ -d "${HOME}" ] ; then
chown "${RUN_UID}" "${HOME}"
fi
# Add a user with UID of person running docker (in ${RUN_UID})
# If $HOME does not yet exist, then it will be created
adduser --disabled-password --gecos 'Docker-User' -u "${RUN_UID}" "${DOCK_USER}"
# Add dockuser to the sudo group
adduser "${DOCK_USER}" sudo
# If root access is needed in the docker image while running as a normal
# user, uncomment this and add 'sudo' as a package installed in Dockerfile
# echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
if [ -z "${RUN_CMD+x}" ] ; then # Launch a shell as dockuser
su -m "${DOCK_USER}" -c /bin/bash
else # Run command as dockuser
su -m "${DOCK_USER}" -c "${RUN_CMD}"
fi
fi
......@@ -349,7 +349,7 @@ TYPEDEF_HIDES_STRUCT = NO
# the optimal cache size from a speed point of view.
# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
LOOKUP_CACHE_SIZE = 3
#---------------------------------------------------------------------------
# Build related configuration options
......@@ -761,7 +761,7 @@ FILE_PATTERNS = *.c \
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = NO
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
......@@ -1975,7 +1975,7 @@ UML_LIMIT_NUM_FIELDS = 10
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = NO
TEMPLATE_RELATIONS = YES
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
# YES then doxygen will generate a graph for each documented file showing the
......@@ -2130,7 +2130,7 @@ DOT_TRANSPARENT = NO
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
DOT_MULTI_TARGETS = YES
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
......
This diff is collapsed.
......@@ -34,7 +34,6 @@ needs_sphinx = '1.6.5'
extensions = ['sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
'breathe'
]
......@@ -191,7 +190,7 @@ texinfo_documents = [
html_add_permalinks = ""
breathe_projects = {
"": "../../../doxygen/xml",
"ngraph": "../../doxygen/xml",
}
rst_epilog = u"""
......
......@@ -4,11 +4,14 @@
Abs
###
.. code-block:: cpp
Abs // Elementwise absolute value operation
Description
===========
Elementwise absolute value operation.
Produces a single output tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the absoloute value of the
value at each ``arg`` coordinate.
......@@ -28,7 +31,7 @@ Outputs
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg``. |
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
......@@ -52,4 +55,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Abs
:project: ngraph
:members:
......@@ -4,14 +4,17 @@
Acos
####
.. code-block:: cpp
Acos // Elementwise acos operation
Description
===========
Elementwise acos operation.
Produces a tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the inverse cosine of the
value at the corresponding coordinate of ``arg`` .
Produces a tensor of the same element type and shape as ``arg``, where the
value at each coordinate of ``output`` is the inverse cosine of the value
at the corresponding coordinate of ``arg``.
Inputs
------
......@@ -28,7 +31,7 @@ Outputs
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg``. |
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
......@@ -51,4 +54,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Acos
:project: ngraph
:members:
......@@ -4,6 +4,11 @@
Add
###
.. code-block:: cpp
Add // Elementwise add operation
Description
===========
......@@ -11,7 +16,7 @@ Elementwise add operation.
Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is the sum of the
value at the corresponding input coordinates.
values at the corresponding input coordinates.
Inputs
------
......@@ -54,4 +59,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Add
:project: ngraph
:members:
......@@ -4,14 +4,17 @@
Asin
####
.. code-block:: cpp
Asin // Elementwise asin operation
Description
===========
Elementwise asin operation.
Produces a tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the inverse sine of the
value at the corresponding coordinate of ``arg`` .
value at the corresponding coordinate of ``arg``.
Inputs
------
......@@ -50,4 +53,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Asin
:project: ngraph
:members:
......@@ -4,14 +4,17 @@
Atan
####
.. code-block:: cpp
Atan // Elementwise atan operation
Description
===========
Elementwise atan operation.
Produces a tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the inverse tangent of the
value at the corresponding coordinate of ``arg`` .
value at the corresponding coordinate of ``arg``.
Inputs
------
......@@ -28,7 +31,7 @@ Outputs
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg``. |
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
......@@ -52,4 +55,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Atan
:project: ngraph
:members:
......@@ -4,11 +4,14 @@
AvgPool
#######
.. code-block:: cpp
AvgPool // Average Pooling operation
Description
===========
Average Pooling operation.
Average pooling windows its input and produces an average for each window.
Inputs
......@@ -35,6 +38,8 @@ Attributes
+----------------------+-----------------+----------------------------------+
| ``q`` | ``Shape[n]`` | Padding above. |
+----------------------+-----------------+----------------------------------+
| ``i`` | ``Boolean`` | Include padding in average. |
+----------------------+-----------------+----------------------------------+
Outputs
-------
......@@ -46,39 +51,100 @@ Outputs
+-----------------+-------------------------+--------------------------------+
Average pooling takes as its input a batch tensor `data` of shape
:math:`(N,C,d_1,\ldots,d_n)` where where :math:`N` is the batch
Average pooling takes as its input, a batch tensor `data` of shape
:math:`(N,C,d_1,\ldots,d_n)`, where where :math:`N` is the batch
size, and :math:`C > 0` is the
number of channels (sometimes called features). The dimensions
number of channels (sometimes called features). The dimensions
:math:`(d_1,\ldots,d_n)` correspond to the shape of an
:math:`n`-dimensional data item in a batch. For example, where
:math:`n=2`, the data may represent a two-dimensional image. It also
takes four attributes:
1. *window shape*,
2. *window movement strides*, (optional)
3. *padding below*, (optional)
4. *padding above*, (optional).
4. *padding above*, (optional)
5. *include padding in average*
The shape of `output` is :math:`(N,C,d'_1,\ldots,d'_n)`, where
:math:`d'_n = \lceil \frac{p_i + d_i + q_i - w_i + 1}{s_i} \rceil`.
**Informal definition:**
If :math:`\textit{i}` is :math:`\textit{true}`, then averages are computed as though the
padding region contained regular elements of value zero.
If :math:`\textit{i}` is :math:`\textit{false}`, then averages are computed using only the non-padding
tensor elements that are present in each window.
*Example:* Consider two instances of this operator with the following attributes:
:math:`\textit{w} = (2,2)`,
:math:`\textit{s} = (1,1)`,
:math:`\textit{p} = (1,1)`,
and (in one instance) :math:`\textit{i} = false` or (in the other instance) :math:`\textit{i} = true`.
Consider how those two operator instances would handle this input tensor:
.. math::
T_\textit{in} = \begin{bmatrix}
1 & 3 & 5 & \ldots \\
7 & 11 & 13 & \ldots \\
17 & 19 & 23 & \ldots \\
\vdots & \vdots & \vdots & \ddots
\end{bmatrix}
Applying the padding indicated by the value of :math:`\textit{p}`, we have the padded image of :math:`T_\textit{in}`
as follows:
.. math::
T_\textit{in,padded} = \begin{bmatrix}
(0) & (0) & (0) & (0) & \ldots \\
(0) & 1 & 3 & 5 & \ldots \\
(0) & 7 & 11 & 13 & \ldots \\
(0) & 17 & 19 & 23 & \ldots \\
(0) & \vdots & \vdots & \vdots & \ddots
\end{bmatrix}
Now consider how the two variations of this example's *AvgPool* operator will compute the "average" value
of the top-left window, which contains exactly the elements:
.. math::
\begin{bmatrix}
(0) & (0) \\
(0) & 1
\end{bmatrix}
If :math:`\textit{i} = false`, then the operator simply ignores the padding elements. It therefore computes the
average of the single-element set :math:`\{ 1 \}`, yielding :math:`1.0`.
If :math:`\textit{i} = true`, then the operator computes the average of the set :math:`\{ 0, 0, 0, 1\}`,
yielding `0.25`.
*Note:* This operator is ill-defined when *both* of the following conditions hold:
(1) :math:`\textit{i} = false`, and (2) the operator's other attribute values indicate
that at least one window will contain only padding elements.
**Formal definition:**
*In the absence of padding*, given an input data batch tensor
:math:`T_\textit{in}`, the output tensor is defined by the equation
:math:`T_\textit{in}`, the output tensor is defined by the equation
.. math::
T_\textit{out}[a,c,i_1,\ldots,i_n] =
\frac{\sum_{j_1 = s_1 i_1, \ldots, j_n = s_n i_n}^{j_1 = s_1 i_1 + w_1 - 1, \ldots, j_n = s_n i_n + w_n - 1}
T_\textit{in}[a,c,j_1,\ldots,j_n]}{\prod_{i=1}^n{w_n}}
*In the presence of padding*, we do not always want to divide by a
reciprocal equal to the number of elements in the window, since some
of the output points are determined by a window that is partly hanging
beyond the edge of the tensor. In this case we can define the output
In this case we can define the output
via a few intermediate steps.
First define the *sum tensor* :math:`T_\textit{sum}`, with shape
:math:`(N,C,d'_1,\ldots,d'_n)`, as follows.
......@@ -87,7 +153,7 @@ First define the *sum tensor* :math:`T_\textit{sum}`, with shape
T_\textit{sum}[a,c,i_1,\ldots,i_n] =
\frac{\sum_{j_1 = s_1 i_1, \ldots, j_n = s_n i_n}^{j_1 = s_1 i_1 + w_1 - 1, \ldots, j_n = s_n i_n + w_n - 1}
\textit{val}[a,c,j_1,\ldots,j_n]}{\prod_{i=1}^n{w_n}}
where
.. math::
......@@ -97,7 +163,7 @@ where
T_\textit{in}[a,c,j_1,\ldots,j_n]&\text{if for all } k, p_k \le j_k < p_k + d_k\\
0&\text{otherwise}.
\end{cases}
Second, define the *divisor tensor* :math:`T_\textit{div}`, with shape :math:`(N,C,d'_1,\ldots,d'_n)`, as follows.
.. math::
......@@ -115,7 +181,7 @@ where
1&\text{if for all }k, p_k \le j_k < p_k + d_k\\
0&\text{otherwise}.
\end{cases}
Finally, define :math:`T_\textit{out}` as the result of elementwise
dividing :math:`T_\textit{sum}` by :math:`T_\textit{div}`. Note that
at positions where :math:`T_\textit{div}` is zero, values may be
......@@ -130,5 +196,6 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::AvgPool
:project: ngraph
:members:
......@@ -4,16 +4,23 @@
AvgPoolBackprop
###############
Average Pooling backprop operation.
.. code-block:: cpp
AvgPoolBackprop // Average Pooling backprop operation.
Description
===========
C++ Interface
=============
.. doxygenclass:: ngraph::op::AvgPoolBackprop
:project: ngraph
:members:
Python Interface
================
is not merged yet, but could go here!
......@@ -4,6 +4,11 @@
Broadcast
#########
.. code-block:: cpp
Broadcast // Operation that produces a tensor based on arg's axes
Description
===========
......@@ -38,7 +43,7 @@ Outputs
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``shape``. |
| ``output`` | Same as ``arg`` | Same as ``shape`` |
+-----------------+-------------------------+--------------------------------+
The shape of ``arg`` must match ``shape`` with elements in ``broadcast_axes`` removed.
......@@ -87,4 +92,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Broadcast
:project: ngraph
:members:
......@@ -4,11 +4,14 @@
Ceiling
#######
.. code-block:: cpp
Ceiling // Elementwise ceiling operation
Description
===========
Elementwise ceiling operation.
Produces a single output tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the ceiling of the
value at each ``arg`` coordinate.
......@@ -28,7 +31,7 @@ Outputs
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg``. |
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
......@@ -54,4 +57,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Ceiling
:project: ngraph
:members:
.. concatenate.rst:
.. concat.rst:
###########
Concatenate
###########
######
Concat
######
Description
===========
.. code-block:: cpp
Concat // Concatenation operation
Description
===========
Produces a single output tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the absoloute value of the
......@@ -29,18 +32,18 @@ Attributes
+-------------------------+----------------------------------+
| Name | Notes |
+=========================+==================================+
| ``concatenation_axis`` | Less than the rank of the shape. |
| ``concatenation_axis`` | Less than the rank of the shape |
+-------------------------+----------------------------------+
Outputs
-------
+-----------------+-------------------------+---------------------------------------------------+
| Name | Element Type | Shape |
+=================+=========================+===================================================+
| ``output`` | Same as ``args` | Same as ``arg`` on non-``concatenation_axis`` |
| | | Sum of ``concatenation_axis`` lengths of ``args`` |
+-----------------+-------------------------+---------------------------------------------------+
+-----------------+-------------------------+----------------------------------------------------+
| Name | Element Type | Shape |
+=================+=========================+====================================================+
| ``output`` | Same as ``args`` | Same as ``arg`` on non-``concatenation_axis`` |
| | | Sum of ``concatenation_axis`` lengths of ``args`` |
+-----------------+-------------------------+----------------------------------------------------+
Mathematical Definition
......@@ -72,5 +75,6 @@ We slice the backprop value into the backprops associated with the inputs.
C++ Interface
=============
.. doxygenclass:: ngraph::op::Concatenate
.. doxygenclass:: ngraph::op::Concat
:project: ngraph
:members:
......@@ -4,11 +4,14 @@
Constant
########
.. code-block:: cpp
Constant // Literal constant tensor
Description
===========
Literal constant tensor.
The output is a tensor initialized from the ``values`` attribute.
Attributes
......@@ -18,13 +21,13 @@ Attributes
| Name | Type | Notes |
+=================+==============================+=======================================+
| ``type`` | ``ngraph::element::type`` | The element type of the value |
| | | in the computation. |
| | | in the computation |
+-----------------+------------------------------+---------------------------------------+
| ``shape`` | ``ngraph::Shape`` | The shape of the constant. |
| ``shape`` | ``ngraph::Shape`` | The shape of the constant |
+-----------------+------------------------------+---------------------------------------+
| ``values`` | ``const std::vector<T>&`` | Constant elements in row-major order. |
| | | T must be compatible with the element |
| | | type. |
| | | type |
+-----------------+------------------------------+---------------------------------------+
Outputs
......@@ -41,4 +44,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Constant
:project: ngraph
:members:
......@@ -4,11 +4,17 @@
Convert
#######
.. code-block:: cpp
Convert // Convert a tensor from one element type to another
Description
===========
Convert a tensor from one element type to another.
.. TODO
Long description
Inputs
------
......@@ -25,7 +31,7 @@ Attributes
+------------------+---------------------------+---------------------------------+
| Name | Type | Notes |
+==================+===========================+=================================+
| ``element_type`` | ``ngraph::element::type`` | The element type of the result. |
| ``element_type`` | ``ngraph::element::type`` | The element type of the result |
+------------------+---------------------------+---------------------------------+
Outputs
......@@ -34,7 +40,7 @@ Outputs
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | ``element_type`` | Same as ``arg``. |
| ``output`` | ``element_type`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
......@@ -50,4 +56,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Convert
:project: ngraph
:members:
......@@ -4,10 +4,19 @@
Convolution
###########
.. code-block:: cpp
Convolution // A batched convolution operation
Description
===========
A batched convolution operation.
.. TODO
Long description
Inputs
------
......@@ -23,24 +32,24 @@ Inputs
Attributes
----------
+-----------------------------+-----------------------------+---------------------------------------+
| Name | Type | Notes |
+=============================+=============================+=======================================+
| ``window_movement_strides`` | ``Strides[n]`` | How far to slide the window along |
| | | each axis at each step. |
+-----------------------------+-----------------------------+---------------------------------------+
| ``window_dilation_strides`` | ``Strides[n]`` | Per-axis dilation to apply to the |
| | | filters. |
+-----------------------------+-----------------------------+---------------------------------------+
| ``padding_below`` | ``Shape[n]`` | How many padding elements to add |
| | | below the 0-coordinate on each axis. |
+-----------------------------+-----------------------------+---------------------------------------+
| ``padding_above`` | ``Shape[n]`` | How manny padding elements to add |
| | | above the max-coordinate on each axis.|
+-----------------------------+-----------------------------+---------------------------------------+
| ``image_dilation_strides`` | ``Strides[n]`` | Per-axis dilation to apply to the |
| | | image batch. |
+-----------------------------+-----------------------------+---------------------------------------+
+-----------------------------+-----------------------------+----------------------------------------+
| Name | Type | Notes |
+=============================+=============================+========================================+
| ``window_movement_strides`` | ``Strides[n]`` | How far to slide the |
| | | window along each axis at each step |
+-----------------------------+-----------------------------+----------------------------------------+
| ``window_dilation_strides`` | ``Strides[n]`` | Per-axis dilation to apply to the |
| | | filters |
+-----------------------------+-----------------------------+----------------------------------------+
| ``padding_below`` | ``Shape[n]`` | How many padding elements to add |
| | | below the 0-coordinate on each axis |
+-----------------------------+-----------------------------+----------------------------------------+
| ``padding_above`` | ``Shape[n]`` | How many padding elements to add above |
| | | the max-coordinate on each axis |
+-----------------------------+-----------------------------+----------------------------------------+
| ``image_dilation_strides`` | ``Strides[n]`` | Per-axis dilation to apply to the |
| | | image batch |
+-----------------------------+-----------------------------+----------------------------------------+
Outputs
......@@ -101,10 +110,18 @@ such that
\mathit{Stride}[s](T)_{i_1,\dots,i_n} \triangleq T_{s_1i_1,\dots,s_ni_n}
:math:`s` is the how far, not the unit of farness.
Convolution
-----------
.. TODO
.. image possibly imported soon; they are not big files but they are svg
..
figure:: ../graphics/classngraph_1_1op_1_1Convolution__coll__graph_org.svg
:height: 500px
Padded, Dilated, Strided Convolution
------------------------------------
......@@ -121,8 +138,8 @@ Batched, Padded, Dilated, Strided Convolution
C++ Interface
=============
.. WIP
.. doxygenclass:: ngraph::op::Convolution
:project: ngraph
:members:
\ No newline at end of file
......@@ -4,11 +4,14 @@
Cos
###
.. code-block:: cpp
Cos // Elementwise cosine operation
Description
===========
Elementwise cosine operation.
Produces a tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the cosine of the
value at the corresponding coordinate of ``arg``.
......@@ -28,7 +31,7 @@ Outputs
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg``. |
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
......@@ -52,4 +55,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Cos
:project: ngraph
:members:
......@@ -4,11 +4,14 @@
Cosh
####
.. code-block:: cpp
Cosh // Elementwise hyperbolic cosine operation
Description
===========
Elementwise hyperbolic cosine operation.
Produces a tensor of the same element type and shape as ``arg``, where
the value at each coordinate of ``output`` is the hyperbolic cosine of
the value at the corresponding coordinate of ``arg``.
......@@ -28,7 +31,7 @@ Outputs
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg``. |
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
......@@ -52,4 +55,5 @@ C++ Interface
=============
.. doxygenclass:: ngraph::op::Cosh
:project: ngraph
:members:
.. divide.rst:
######
Divide
######
.. code-block:: cpp
Divide // Elementwise divide operation
Description
===========
Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is the quotient of the
values at the corresponding input coordinates.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg0`` | any | any |
+-----------------+-------------------------+--------------------------------+
| ``arg1`` | same as ``arg0`` | same as ``arg0`` |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | same as ``arg0`` | same as ``arg0`` |
+-----------------+-------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\texttt{output}_{i_0, \ldots, i_{n-1}} = \frac{\texttt{arg0}_{i_0, \ldots, i_{n-1}}}{\texttt{arg1}_{i_0, \ldots, i_{n-1}}}
Backprop
========
.. math::
\overline{\texttt{arg0}} &\leftarrow \frac{\Delta}{\texttt{arg1}}\\
\overline{\texttt{arg1}} &\leftarrow -\Delta \frac{\texttt{Output}}{\texttt{arg1}}
C++ Interface
=============
.. doxygenclass:: ngraph::op::Divide
:project: ngraph
:members:
.. dot.rst:
###
Dot
###
.. code-block:: cpp
Dot // Generalized dot product operation
Description
===========
Generalized dot product operation, including scalar-tensor product,
matrix-vector product, and matrix multiplication.
A few common cases are as follows:
* If :math:`m = 0` and :math:`n = 1` or :math:`p = 1`, the operation
is a scalar-tensor product.
* If :math:`m = 1`, :math:`n = 2`, and :math:`p = 1`, the operation is
a matrix-vector product.
* If :math:`m = 1` and :math:`n = p = 2`, the operation is a matrix
multiplication.
Inputs
------
+-----------------+-------------------------+-----------------------------------------+
| Name | Element Type | Shape |
+=================+=========================+=========================================+
| ``arg0`` | any | :math:`(i_1,\dots,i_n,j_1,\dots,j_m)` |
+-----------------+-------------------------+-----------------------------------------+
| ``arg1`` | same as ``arg0`` | :math:`(j_1,\ldots,j_m,k_1,\dots,k_p)` |
+-----------------+-------------------------+-----------------------------------------+
Attributes
----------
+------------------------+---------------+--------------------------------------------------+
| Name | | |
+========================+===============+==================================================+
| reduction_axes_count | ``size_t`` | The number of axes to reduce through dot-product |
| | | (corresponds to :math:`m` in the formulas above) |
+------------------------+---------------+--------------------------------------------------+
Outputs
-------
+-----------------+-------------------------+----------------------------------------+
| Name | Element Type | Shape |
+=================+=========================+========================================+
| ``output`` | same as ``arg0`` | :math:`(i_1,\ldots,i_n,k_1,\dots,k_p)` |
+-----------------+-------------------------+----------------------------------------+
Mathematical Definition
=======================
.. math::
\texttt{output}_{i_1,\dots,i_n,k_1,\ldots,k_p} =
\begin{cases}
\texttt{arg0}_{i_1,\dots,i_n} \cdot
\texttt{arg1}_{k_1,\dots,k_p}&\text{if }m=0,\\
\sum_{j_1, \ldots, j_m}
\texttt{arg0}_{i_1,\dots,i_n,j_1,\dots,j_m}
\cdot
\texttt{arg1}_{j_1,\ldots,j_m,k_1,\ldots,k_p}
&\text{otherwise}.
\end{cases}
Backprop
========
To be documented.
C++ Interface
=============
.. doxygenclass:: ngraph::op::Dot
:project: ngraph
:members:
.. equal.rst:
#####
Equal
#####
.. code-block:: cpp
Equal // Elementwise equal operation
Description
===========
Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is ``1`` (true) if
``arg0`` is equal to ``arg1``, ``0`` otherwise.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg0`` | any | any |
+-----------------+-------------------------+--------------------------------+
| ``arg1`` | same as ``arg0`` | same as ``arg0`` |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+------------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+==============================+================================+
| ``output`` | ``ngraph::element::boolean`` | same as ``arg0`` |
+-----------------+------------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\texttt{output}_{i_0, \ldots, i_{n-1}} = \texttt{arg0}_{i_0, \ldots, i_{n-1}} == \texttt{arg1}_{i_0, \ldots, i_{n-1}}
C++ Interface
=============
.. doxygenclass:: ngraph::op::Equal
:project: ngraph
:members:
.. exp.rst:
###
Exp
###
.. code-block:: cpp
Exp // Elementwise expine operation
Description
===========
Produces a tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the expine of the
value at the corresponding coordinate of ``arg``.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg`` | Any | Any |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\texttt{output}_{i_0, \ldots, i_{n-1}} = \exp(\texttt{arg}_{i_0, \ldots, i_{n-1}})
Backprop
========
.. math::
\overline{\texttt{arg}} \leftarrow \Delta\ \texttt{output}
C++ Interface
=============
.. doxygenclass:: ngraph::op::Exp
:project: ngraph
:members:
.. floor.rst:
#####
Floor
#####
.. code-block:: cpp
Floor // Elementwise floor operation
Description
===========
Produces a single output tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the floor of the
value at each ``arg`` coordinate.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg`` | Any | Any |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\mathtt{output}_{i_0, \ldots, i_{n-1}} = \lfloor \mathtt{arg}_{i_0,
\ldots, i_{n-1}}\rfloor
Backprop
========
Not defined by nGraph.
The backprop would be zero for non-integer
input and undefined for integer input; a zero backprop would have
no effect on the backprop to ``arg``, so there is no need for ``Floor``
to define a backprop.
C++ Interface
=============
.. doxygenclass:: ngraph::op::Floor
:project: ngraph
:members:
.. function_call.rst:
############
FunctionCall
############
.. code-block:: cpp
FunctionCall // Function call operation
Description
===========
Calls the specified function on ``args``. The results of the function are the outputs
of the op.
Inputs
------
+------------+--------------------+----------------------------------------------+
| Name | Type | |
+============+====================+==============================================+
| ``args`` | ``ngraph::Nodes`` | Element types and shapes must correspond to |
| | | the parameters of ``function`` |
+------------+--------------------+----------------------------------------------+
Attributes
----------
+----------------+---------------------------------------+
| Name | Type |
+================+=======================================+
| ``function`` | ``std::shared_ptr<ngraph::Function>`` |
+----------------+---------------------------------------+
Outputs
-------
One output for each function result.
C++ Interface
=============
.. doxygenclass:: ngraph::op::FunctionCall
:project: ngraph
:members:
.. greater.rst:
#######
Greater
#######
.. code-block:: cpp
Greater // Elementwise greater operation
Description
===========
Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is true (1) if
``arg0`` is greater than ``arg1``, 0 otherwise.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg0`` | any | any |
+-----------------+-------------------------+--------------------------------+
| ``arg1`` | same as ``arg0`` | same as ``arg0`` |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+------------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+==============================+================================+
| ``output`` | ``ngraph::element::boolean`` | same as ``arg0`` |
+-----------------+------------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\texttt{output}_{i_0, \ldots, i_{n-1}} = \texttt{arg0}_{i_0, \ldots, i_{n-1}} > \texttt{arg1}_{i_0, \ldots, i_{n-1}}
C++ Interface
=============
.. doxygenclass:: ngraph::op::Greater
:project: ngraph
:members:
.. greater_eq.rst:
#########
GreaterEq
#########
.. code-block:: cpp
GreaterEq // Elementwise greater or equal operation
Description
===========
Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is true (1) if
``arg0`` is greater than or equal to ``arg1``, 0 otherwise.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg0`` | any | any |
+-----------------+-------------------------+--------------------------------+
| ``arg1`` | same as ``arg0`` | same as ``arg0`` |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+------------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+==============================+================================+
| ``output`` | ``ngraph::element::boolean`` | same as ``arg0`` |
+-----------------+------------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\texttt{output}_{i_0, \ldots, i_{n-1}} = \texttt{arg0}_{i_0, \ldots, i_{n-1}} \ge \texttt{arg1}_{i_0, \ldots, i_{n-1}}
C++ Interface
=============
.. doxygenclass:: ngraph::op::GreaterEq
:project: ngraph
:members:
......@@ -57,10 +57,26 @@ Not currently a comprehensive list.
avg_pool_backprop.rst
broadcast.rst
ceiling.rst
concatenate.rst
concat.rst
constant.rst
convert.rst
convolution.rst
cos.rst
cosh.rst
divide.rst
dot.rst
equal.rst
exp.rst
floor.rst
function_call.rst
greater_eq.rst
greater.rst
less_eq.rst
less.rst
log.rst
maximum.rst
minimum.rst
multiply.rst
negative.rst
not_equal.rst
not.rst
.. less.rst:
####
Less
####
.. code-block:: cpp
Less // Elementwise less operation
Description
===========
Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is true (1) if
``arg0`` is less than ``arg1``, 0 otherwise.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg0`` | any | any |
+-----------------+-------------------------+--------------------------------+
| ``arg1`` | same as ``arg0`` | same as ``arg0`` |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+------------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+==============================+================================+
| ``output`` | ``ngraph::element::boolean`` | same as ``arg0`` |
+-----------------+------------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\texttt{output}_{i_0, \ldots, i_{n-1}} = \texttt{arg0}_{i_0, \ldots, i_{n-1}} < \texttt{arg1}_{i_0, \ldots, i_{n-1}}
C++ Interface
=============
.. doxygenclass:: ngraph::op::Less
:project: ngraph
:members:
.. less_eq.rst:
######
LessEq
######
.. code-block:: cpp
LessEq // Elementwise less or equal operation
Description
===========
Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is true (1) if
``arg0`` is less than or equal to ``arg1``, 0 otherwise.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg0`` | any | any |
+-----------------+-------------------------+--------------------------------+
| ``arg1`` | same as ``arg0`` | same as ``arg0`` |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+------------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+==============================+================================+
| ``output`` | ``ngraph::element::boolean`` | same as ``arg0`` |
+-----------------+------------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\texttt{output}_{i_0, \ldots, i_{n-1}} = \texttt{arg0}_{i_0, \ldots, i_{n-1}} \le \texttt{arg1}_{i_0, \ldots, i_{n-1}}
C++ Interface
=============
.. doxygenclass:: ngraph::op::LessEq
:project: ngraph
:members:
.. log.rst:
###
Log
###
.. code-block:: cpp
Log // Elementwise logine operation
Description
===========
Produces a tensor of the same element type and shape as ``arg``,
where the value at each coordinate of ``output`` is the logine of the
value at the corresponding coordinate of ``arg``.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg`` | Any | Any |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\texttt{output}_{i_0, \ldots, i_{n-1}} = \log(\texttt{arg}_{i_0, \ldots, i_{n-1}})
Backprop
========
.. math::
\overline{\texttt{arg}} \leftarrow \frac{\Delta}{\texttt{input}}
C++ Interface
=============
.. doxygenclass:: ngraph::op::Log
:project: ngraph
:members:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -44,16 +44,16 @@ standards:
- Assign template parameters with ``UPPER_SNAKE_CASE``.
- Case variable and function names with ``snake_case``.
Method names for basic acceesors are prefixed by ``get_`` or ``set_`` and
should have simple *O(1)* implementations:
Method names for basic accessors are prefixed by ``get_`` or ``set_`` and
should have simple :math:`\mathcal{O}(1)` implementations:
- A ``get_`` method should be externally idempotent. It may perform some simple
initialization and cache the result for later use.
- ``is_`` may be used instead of ``get_`` for boolean accessors. Trivial ``get_``
- An ``is_`` may be used instead of ``get_`` for boolean accessors. Trivial ``get_``
methods can be defined in a header file.
- A ``set_`` method should change the value returned by the corresponding``get_``
- A ``set_`` method should change the value returned by the corresponding ``get_``
method.
* Use ``set_is_`` if using ``is_`` to get a value.
......
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