Unverified Commit 5c8f9222 authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

add curly braces in copy_with_new_args (#500)

parent db595a3a
...@@ -45,7 +45,9 @@ namespace ngraph ...@@ -45,7 +45,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Abs>(new_args.at(0)); return std::make_shared<Abs>(new_args.at(0));
} }
......
...@@ -45,7 +45,9 @@ namespace ngraph ...@@ -45,7 +45,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Acos>(new_args.at(0)); return std::make_shared<Acos>(new_args.at(0));
} }
}; };
......
...@@ -47,7 +47,9 @@ namespace ngraph ...@@ -47,7 +47,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Add>(new_args.at(0), new_args.at(1)); return std::make_shared<Add>(new_args.at(0), new_args.at(1));
} }
......
...@@ -32,7 +32,9 @@ namespace ngraph ...@@ -32,7 +32,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<AllReduce>(new_args.at(0)); return std::make_shared<AllReduce>(new_args.at(0));
} }
}; };
......
...@@ -45,7 +45,9 @@ namespace ngraph ...@@ -45,7 +45,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Asin>(new_args.at(0)); return std::make_shared<Asin>(new_args.at(0));
} }
}; };
......
...@@ -45,7 +45,9 @@ namespace ngraph ...@@ -45,7 +45,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Atan>(new_args.at(0)); return std::make_shared<Atan>(new_args.at(0));
} }
}; };
......
...@@ -69,7 +69,9 @@ namespace ngraph ...@@ -69,7 +69,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<AvgPool>(new_args.at(0), return std::make_shared<AvgPool>(new_args.at(0),
m_window_shape, m_window_shape,
...@@ -110,7 +112,9 @@ namespace ngraph ...@@ -110,7 +112,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
AvgPoolBackprop* avpn = new AvgPoolBackprop(m_forward_arg_shape, AvgPoolBackprop* avpn = new AvgPoolBackprop(m_forward_arg_shape,
new_args.at(0), new_args.at(0),
......
...@@ -40,7 +40,9 @@ namespace ngraph ...@@ -40,7 +40,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Broadcast>(new_args.at(0), m_shape, m_broadcast_axes); return std::make_shared<Broadcast>(new_args.at(0), m_shape, m_broadcast_axes);
} }
......
...@@ -38,7 +38,9 @@ namespace ngraph ...@@ -38,7 +38,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Ceiling>(new_args.at(0)); return std::make_shared<Ceiling>(new_args.at(0));
} }
}; };
......
...@@ -58,7 +58,9 @@ namespace ngraph ...@@ -58,7 +58,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Convert>(new_args.at(0), m_element_type); return std::make_shared<Convert>(new_args.at(0), m_element_type);
} }
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Cos>(new_args.at(0)); return std::make_shared<Cos>(new_args.at(0));
} }
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Cosh>(new_args.at(0)); return std::make_shared<Cosh>(new_args.at(0));
} }
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Divide>(new_args.at(0), new_args.at(1)); return std::make_shared<Divide>(new_args.at(0), new_args.at(1));
} }
......
...@@ -83,7 +83,9 @@ namespace ngraph ...@@ -83,7 +83,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Dot>( return std::make_shared<Dot>(
new_args.at(0), new_args.at(1), m_reduction_axes_count); new_args.at(0), new_args.at(1), m_reduction_axes_count);
} }
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Equal>(new_args.at(0), new_args.at(1)); return std::make_shared<Equal>(new_args.at(0), new_args.at(1));
} }
}; };
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Exp>(new_args.at(0)); return std::make_shared<Exp>(new_args.at(0));
} }
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Floor>(new_args.at(0)); return std::make_shared<Floor>(new_args.at(0));
} }
}; };
......
...@@ -54,7 +54,9 @@ namespace ngraph ...@@ -54,7 +54,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<GetOutputElement>(new_args.at(0), m_n); return std::make_shared<GetOutputElement>(new_args.at(0), m_n);
} }
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Greater>(new_args.at(0), new_args.at(1)); return std::make_shared<Greater>(new_args.at(0), new_args.at(1));
} }
}; };
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<GreaterEq>(new_args.at(0), new_args.at(1)); return std::make_shared<GreaterEq>(new_args.at(0), new_args.at(1));
} }
}; };
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Less>(new_args.at(0), new_args.at(1)); return std::make_shared<Less>(new_args.at(0), new_args.at(1));
} }
}; };
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<LessEq>(new_args.at(0), new_args.at(1)); return std::make_shared<LessEq>(new_args.at(0), new_args.at(1));
} }
}; };
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Log>(new_args.at(0)); return std::make_shared<Log>(new_args.at(0));
} }
......
...@@ -76,7 +76,9 @@ namespace ngraph ...@@ -76,7 +76,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<MaxPool>( return std::make_shared<MaxPool>(
new_args.at(0), m_window_shape, m_window_movement_strides); new_args.at(0), m_window_shape, m_window_movement_strides);
} }
...@@ -114,7 +116,9 @@ namespace ngraph ...@@ -114,7 +116,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
MaxPoolBackprop* mpbp = new MaxPoolBackprop(new_args.at(0), MaxPoolBackprop* mpbp = new MaxPoolBackprop(new_args.at(0),
new_args.at(1), new_args.at(1),
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Maximum>(new_args.at(0), new_args.at(1)); return std::make_shared<Maximum>(new_args.at(0), new_args.at(1));
} }
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Minimum>(new_args.at(0), new_args.at(1)); return std::make_shared<Minimum>(new_args.at(0), new_args.at(1));
} }
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Multiply>(new_args.at(0), new_args.at(1)); return std::make_shared<Multiply>(new_args.at(0), new_args.at(1));
} }
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Negative>(new_args.at(0)); return std::make_shared<Negative>(new_args.at(0));
} }
......
...@@ -47,7 +47,9 @@ namespace ngraph ...@@ -47,7 +47,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Not>(new_args.at(0)); return std::make_shared<Not>(new_args.at(0));
} }
}; };
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<NotEqual>(new_args.at(0), new_args.at(1)); return std::make_shared<NotEqual>(new_args.at(0), new_args.at(1));
} }
}; };
......
...@@ -56,7 +56,9 @@ namespace ngraph ...@@ -56,7 +56,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<OneHot>(new_args.at(0), m_shape, m_one_hot_axis); return std::make_shared<OneHot>(new_args.at(0), m_shape, m_one_hot_axis);
} }
......
...@@ -30,7 +30,9 @@ op::Parameter::Parameter(const ngraph::element::Type& element_type, const Shape& ...@@ -30,7 +30,9 @@ op::Parameter::Parameter(const ngraph::element::Type& element_type, const Shape&
shared_ptr<Node> op::Parameter::copy_with_new_args(const vector<shared_ptr<Node>>& new_args) const shared_ptr<Node> op::Parameter::copy_with_new_args(const vector<shared_ptr<Node>>& new_args) const
{ {
if (new_args.size() != 0) if (new_args.size() != 0)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
const descriptor::Output& output = get_outputs().at(0); const descriptor::Output& output = get_outputs().at(0);
return make_shared<Parameter>(output.get_element_type(), output.get_shape()); return make_shared<Parameter>(output.get_element_type(), output.get_shape());
} }
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Power>(new_args.at(0), new_args.at(1)); return std::make_shared<Power>(new_args.at(0), new_args.at(1));
} }
......
...@@ -100,7 +100,9 @@ namespace ngraph ...@@ -100,7 +100,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Reduce>( return std::make_shared<Reduce>(
new_args.at(0), new_args.at(1), m_reduction_function, m_reduction_axes); new_args.at(0), new_args.at(1), m_reduction_function, m_reduction_axes);
} }
......
...@@ -70,7 +70,9 @@ namespace ngraph ...@@ -70,7 +70,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<ReduceWindow>(new_args.at(0), return std::make_shared<ReduceWindow>(new_args.at(0),
new_args.at(1), new_args.at(1),
m_reduction_function, m_reduction_function,
......
...@@ -54,7 +54,9 @@ namespace ngraph ...@@ -54,7 +54,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Remainder>(new_args.at(0), new_args.at(1)); return std::make_shared<Remainder>(new_args.at(0), new_args.at(1));
} }
}; };
......
...@@ -78,7 +78,9 @@ namespace ngraph ...@@ -78,7 +78,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<ReplaceSlice>( return std::make_shared<ReplaceSlice>(
new_args.at(0), new_args.at(1), m_lower_bounds, m_upper_bounds, m_strides); new_args.at(0), new_args.at(1), m_lower_bounds, m_upper_bounds, m_strides);
} }
......
...@@ -73,7 +73,9 @@ namespace ngraph ...@@ -73,7 +73,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Reshape>(new_args.at(0), m_input_order, m_output_shape); return std::make_shared<Reshape>(new_args.at(0), m_input_order, m_output_shape);
} }
......
...@@ -56,7 +56,9 @@ namespace ngraph ...@@ -56,7 +56,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Reverse>(new_args.at(0), m_reversed_axes); return std::make_shared<Reverse>(new_args.at(0), m_reversed_axes);
} }
......
...@@ -53,7 +53,9 @@ namespace ngraph ...@@ -53,7 +53,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 3) if (new_args.size() != 3)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Select>(new_args.at(0), new_args.at(1), new_args.at(2)); return std::make_shared<Select>(new_args.at(0), new_args.at(1), new_args.at(2));
} }
......
...@@ -91,7 +91,9 @@ namespace ngraph ...@@ -91,7 +91,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 3) if (new_args.size() != 3)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<SelectAndScatter>(new_args.at(0), return std::make_shared<SelectAndScatter>(new_args.at(0),
new_args.at(1), new_args.at(1),
new_args.at(2), new_args.at(2),
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Sign>(new_args.at(0)); return std::make_shared<Sign>(new_args.at(0));
} }
}; };
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Sin>(new_args.at(0)); return std::make_shared<Sin>(new_args.at(0));
} }
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Sinh>(new_args.at(0)); return std::make_shared<Sinh>(new_args.at(0));
} }
......
...@@ -76,7 +76,9 @@ namespace ngraph ...@@ -76,7 +76,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Slice>( return std::make_shared<Slice>(
new_args.at(0), m_lower_bounds, m_upper_bounds, m_strides); new_args.at(0), m_lower_bounds, m_upper_bounds, m_strides);
} }
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Sqrt>(new_args.at(0)); return std::make_shared<Sqrt>(new_args.at(0));
} }
......
...@@ -52,7 +52,9 @@ namespace ngraph ...@@ -52,7 +52,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Subtract>(new_args.at(0), new_args.at(1)); return std::make_shared<Subtract>(new_args.at(0), new_args.at(1));
} }
......
...@@ -89,7 +89,9 @@ namespace ngraph ...@@ -89,7 +89,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Sum>(new_args.at(0), m_reduction_axes); return std::make_shared<Sum>(new_args.at(0), m_reduction_axes);
} }
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Tan>(new_args.at(0)); return std::make_shared<Tan>(new_args.at(0));
} }
......
...@@ -50,7 +50,9 @@ namespace ngraph ...@@ -50,7 +50,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<Tanh>(new_args.at(0)); return std::make_shared<Tanh>(new_args.at(0));
} }
......
...@@ -55,7 +55,9 @@ namespace ngraph ...@@ -55,7 +55,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<XLAGetTupleElement>(new_args.at(0), m_n); return std::make_shared<XLAGetTupleElement>(new_args.at(0), m_n);
} }
......
...@@ -47,7 +47,9 @@ namespace ngraph ...@@ -47,7 +47,9 @@ namespace ngraph
const std::vector<std::shared_ptr<Node>>& new_args) const override const std::vector<std::shared_ptr<Node>>& new_args) const override
{ {
if (new_args.size() != 1) if (new_args.size() != 1)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<ConvertLayout>(new_args.at(0), output_layout); return std::make_shared<ConvertLayout>(new_args.at(0), output_layout);
} }
......
...@@ -20,7 +20,9 @@ std::shared_ptr<ngraph::Node> ngraph::op::MatmulBias::copy_with_new_args( ...@@ -20,7 +20,9 @@ std::shared_ptr<ngraph::Node> ngraph::op::MatmulBias::copy_with_new_args(
const std::vector<std::shared_ptr<ngraph::Node>>& new_args) const const std::vector<std::shared_ptr<ngraph::Node>>& new_args) const
{ {
if (new_args.size() != 2) if (new_args.size() != 2)
{
throw ngraph_error("Incorrect number of new arguments"); throw ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<MatmulBias>(new_args.at(0), return std::make_shared<MatmulBias>(new_args.at(0),
new_args.at(1), new_args.at(1),
new_args.at(1), new_args.at(1),
......
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