Unverified Commit ece8c213 authored by Jayaram Bobba's avatar Jayaram Bobba Committed by GitHub

Merge branch 'master' into jbobba/mkldnn_v0.13

parents 124def0c 6a1b2ee2
......@@ -71,6 +71,10 @@ namespace ngraph
{
arg->m_users.erase(this);
}
for (auto& input : m_inputs)
{
input.get_output().remove_input(&input);
}
}
virtual void generate_adjoints(autodiff::Adjoints& adjoints,
const std::shared_ptr<Node>& delta)
......
......@@ -319,7 +319,7 @@ private:
else if (node_op == "Concat")
{
const op::Concat* concat = static_cast<const op::Concat*>(&node);
std::vector<T*> in_args;
std::vector<const T*> in_args;
std::vector<Shape> in_shapes;
for (std::shared_ptr<HostTensorView> arg : args)
{
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void abs(T* arg, T* out, size_t count)
void abs(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void acos(T* arg, T* out, size_t count)
void acos(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void add(T* arg0, T* arg1, T* out, size_t count)
void add(const T* arg0, const T* arg1, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void allreduce(T* arg, T* out, const element::Type element_type, int count)
void allreduce(const T* arg, T* out, const element::Type element_type, int count)
{
auto data_type = MPI_FLOAT;
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void asin(T* arg, T* out, size_t count)
void asin(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void atan(T* arg, T* out, size_t count)
void atan(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -31,7 +31,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void avg_pool_backprop(T* delta,
void avg_pool_backprop(const T* delta,
T* out,
const Shape& delta_shape,
const Shape& out_shape,
......@@ -120,7 +120,7 @@ namespace ngraph
}
template <typename T>
void avg_pool(T* arg,
void avg_pool(const T* arg,
T* out,
const Shape& arg_shape,
const Shape& out_shape,
......
......@@ -27,7 +27,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void broadcast(T* arg,
void broadcast(const T* arg,
T* out,
const Shape& in_shape,
const Shape& out_shape,
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void ceiling(T* arg, T* out, size_t count)
void ceiling(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -27,7 +27,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void concat(const std::vector<T*>& args,
void concat(const std::vector<const T*>& args,
T* out,
const std::vector<Shape>& in_shapes,
const Shape& out_shape,
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename TI, typename TO>
void convert(TI* arg, TO* out, size_t count)
void convert(const TI* arg, TO* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -29,8 +29,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void convolution(T* arg0,
T* arg1,
void convolution(const T* arg0,
const T* arg1,
T* out,
const Shape& arg0_shape,
const Shape& arg1_shape,
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void copy(T* arg, T* out, size_t count)
void copy(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void cos(T* arg, T* out, size_t count)
void cos(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void cosh(T* arg, T* out, size_t count)
void cosh(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -32,7 +32,7 @@ namespace ngraph
// In English: return type is void and T must be an integral type.
template <typename T>
typename std::enable_if<std::is_integral<T>::value>::type
divide(T* arg0, T* arg1, T* out, size_t count)
divide(const T* arg0, const T* arg1, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......@@ -47,7 +47,7 @@ namespace ngraph
// In English: return type is void and T must be a floating point type.
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value>::type
divide(T* arg0, T* arg1, T* out, size_t count)
divide(const T* arg0, const T* arg1, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -28,8 +28,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void dot(T* arg0,
T* arg1,
void dot(const T* arg0,
const T* arg1,
T* out,
const Shape& arg0_shape,
const Shape& arg1_shape,
......
......@@ -28,8 +28,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void equal(T* arg0,
T* arg1,
void equal(const T* arg0,
const T* arg1,
char* out,
size_t count) // TODO: using char for bool, is this right?
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void exp(T* arg, T* out, size_t count)
void exp(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void floor(T* arg, T* out, size_t count)
void floor(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -25,8 +25,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void greater(T* arg0,
T* arg1,
void greater(const T* arg0,
const T* arg1,
char* out,
size_t count) // TODO: using char for bool, is this right?
{
......
......@@ -25,8 +25,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void greater_eq(T* arg0,
T* arg1,
void greater_eq(const T* arg0,
const T* arg1,
char* out,
size_t count) // TODO: using char for bool, is this right?
{
......
......@@ -25,8 +25,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void less(T* arg0,
T* arg1,
void less(const T* arg0,
const T* arg1,
char* out,
size_t count) // TODO: using char for bool, is this right?
{
......
......@@ -25,8 +25,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void less_eq(T* arg0,
T* arg1,
void less_eq(const T* arg0,
const T* arg1,
char* out,
size_t count) // TODO: using char for bool, is this right?
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void log(T* arg, T* out, size_t count)
void log(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -28,7 +28,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void max(T* arg,
void max(const T* arg,
T* out,
const Shape& in_shape,
const Shape& out_shape,
......
......@@ -28,8 +28,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void max_pool_backprop(T* arg_forward,
T* delta,
void max_pool_backprop(const T* arg_forward,
const T* delta,
T* out,
const Shape& delta_shape,
const Shape& out_shape, // same as arg_forward_shape
......@@ -122,7 +122,7 @@ namespace ngraph
}
template <typename T>
void max_pool(T* arg,
void max_pool(const T* arg,
T* out,
const Shape& arg_shape,
const Shape& out_shape,
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void maximum(T* arg0, T* arg1, T* out, size_t count)
void maximum(const T* arg0, const T* arg1, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -28,7 +28,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void min(T* arg,
void min(const T* arg,
T* out,
const Shape& in_shape,
const Shape& out_shape,
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void minimum(T* arg0, T* arg1, T* out, size_t count)
void minimum(const T* arg0, const T* arg1, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void multiply(T* arg0, T* arg1, T* out, size_t count)
void multiply(const T* arg0, const T* arg1, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void negate(T* arg, T* out, size_t count)
void negate(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
static inline void
logical_not(char* arg,
logical_not(const char* arg,
char* out,
size_t count) // TODO: using char for bool, is this right?
{
......
......@@ -28,8 +28,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void not_equal(T* arg0,
T* arg1,
void not_equal(const T* arg0,
const T* arg1,
char* out,
size_t count) // TODO: using char for bool, is this right?
{
......
......@@ -29,8 +29,11 @@ namespace ngraph
// NOTE: Execution throws `std::range_error` if either a non-integral value or an out-of-bounds
// value is detected in the input tensor.
template <typename T>
void one_hot(
T* arg, T* out, const Shape& in_shape, const Shape& out_shape, size_t one_hot_axis)
void one_hot(const T* arg,
T* out,
const Shape& in_shape,
const Shape& out_shape,
size_t one_hot_axis)
{
// Step 1: Zero out the output.
CoordinateTransform output_transform(out_shape);
......
......@@ -28,8 +28,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void pad(T* arg0,
T* arg1,
void pad(const T* arg0,
const T* arg1,
T* out,
const Shape& arg0_shape,
const Shape& out_shape,
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void power(T* arg0, T* arg1, T* out, size_t count)
void power(const T* arg0, const T* arg1, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -27,7 +27,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void product(T* arg,
void product(const T* arg,
T* out,
const Shape& in_shape,
const Shape& out_shape,
......
......@@ -28,8 +28,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void reduce(T* arg0,
T* arg1, // TODO: really we should just pass a T here.
void reduce(const T* arg0,
const T* arg1, // TODO: really we should just pass a T here.
T* out,
const Shape& in_shape,
const Shape& out_shape,
......
......@@ -28,8 +28,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void reduce_window(T* arg_reductee,
T* arg_init,
void reduce_window(const T* arg_reductee,
const T* arg_init,
T* out,
const Shape& arg_reductee_shape,
const Shape& out_shape,
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void relu(T* arg, T* out, size_t count)
void relu(const T* arg, T* out, size_t count)
{
T zero = 0;
for (size_t i = 0; i < count; i++)
......@@ -34,7 +34,7 @@ namespace ngraph
}
}
template <typename T>
void relu_backprop(T* arg, T* delta_arg, T* out, size_t count)
void relu_backprop(const T* arg, T* delta_arg, T* out, size_t count)
{
T zero = 0;
for (size_t i = 0; i < count; i++)
......
......@@ -27,8 +27,8 @@ namespace ngraph
namespace kernel
{
template <typename T>
void replace_slice(T* arg0, // replacement context
T* arg1, // replacement value
void replace_slice(const T* arg0, // replacement context
const T* arg1, // replacement value
T* out,
const Shape& arg1_shape,
const Coordinate& lower_bounds,
......
......@@ -28,7 +28,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void reshape(T* arg,
void reshape(const T* arg,
T* out,
const Shape& in_shape,
const AxisVector& in_axis_order,
......
......@@ -27,7 +27,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void result(T* arg, T* out, size_t count)
void result(const T* arg, T* out, size_t count)
{
memcpy(out, arg, sizeof(T) * count);
}
......
......@@ -27,7 +27,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void reverse(T* arg,
void reverse(const T* arg,
T* out,
const Shape& arg_shape,
const Shape& out_shape,
......
......@@ -25,9 +25,9 @@ namespace ngraph
namespace kernel
{
template <typename T>
void select(char* arg0,
T* arg1,
T* arg2,
void select(const char* arg0,
const T* arg1,
const T* arg2,
T* out,
size_t count) // TODO: using char for bool, is this right?
{
......
......@@ -28,9 +28,9 @@ namespace ngraph
namespace kernel
{
template <typename T>
void select_and_scatter(T* arg_selectee,
T* arg_source,
T* arg_init,
void select_and_scatter(const T* arg_selectee,
const T* arg_source,
const T* arg_init,
T* out,
const Shape& arg_selectee_shape,
const Shape& arg_source_shape,
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void sign(T* arg, T* out, size_t count)
void sign(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void sin(T* arg, T* out, size_t count)
void sin(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void sinh(T* arg, T* out, size_t count)
void sinh(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -27,7 +27,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void slice(T* arg,
void slice(const T* arg,
T* out,
const Shape& arg_shape,
const Coordinate& lower_bounds,
......
......@@ -28,7 +28,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void softmax(T* arg, T* out, const Shape& shape, const AxisSet& axes)
void softmax(const T* arg, T* out, const Shape& shape, const AxisSet& axes)
{
auto temp_shape = project(shape, axes);
auto temp_elements = std::accumulate(
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void sqrt(T* arg, T* out, size_t count)
void sqrt(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -25,7 +25,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void subtract(T* arg0, T* arg1, T* out, size_t count)
void subtract(const T* arg0, const T* arg1, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -27,7 +27,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void sum(T* arg,
void sum(const T* arg,
T* out,
const Shape& in_shape,
const Shape& out_shape,
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void tan(T* arg, T* out, size_t count)
void tan(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
......@@ -26,7 +26,7 @@ namespace ngraph
namespace kernel
{
template <typename T>
void tanh(T* arg, T* out, size_t count)
void tanh(const T* arg, T* out, size_t count)
{
for (size_t i = 0; i < count; i++)
{
......
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