From 461a71b64135e8b5c51947b53a7f4a533c097b7d Mon Sep 17 00:00:00 2001 From: Patryk Elszkowski Date: Wed, 3 Feb 2021 05:50:50 +0100 Subject: [PATCH] ngraph Constant operator - add `const` for c-tor input parameters (#4091) Co-authored-by: Patryk Elszkowski --- ngraph/core/include/ngraph/op/constant.hpp | 8 +++++--- ngraph/core/src/op/constant.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ngraph/core/include/ngraph/op/constant.hpp b/ngraph/core/include/ngraph/op/constant.hpp index add0d105a47..93724d8cf16 100644 --- a/ngraph/core/include/ngraph/op/constant.hpp +++ b/ngraph/core/include/ngraph/op/constant.hpp @@ -54,7 +54,9 @@ namespace ngraph /// \param values A vector of literals for initializing the tensor constant. The /// size of values must match the size of the shape. template - Constant(const element::Type& type, Shape shape, const std::vector& values) + Constant(const element::Type& type, + const Shape& shape, + const std::vector& values) : Constant(type, shape) { NODE_VALIDATION_CHECK( @@ -91,7 +93,7 @@ namespace ngraph /// value is broadcast to the specified shape. template ::value>::type> - Constant(const element::Type& type, Shape shape, T value) + Constant(const element::Type& type, const Shape& shape, T value) : Constant(type, shape) { auto size = shape_size(m_shape); @@ -224,7 +226,7 @@ namespace ngraph /// \param shape The shape of the tensor constant. /// \param values A list of string values to use as the constant data. Constant(const element::Type& type, - Shape shape, + const Shape& shape, const std::vector& values); /// \brief Constructs a tensor constant with the supplied data diff --git a/ngraph/core/src/op/constant.cpp b/ngraph/core/src/op/constant.cpp index 32954b651c5..d7fcfb93137 100644 --- a/ngraph/core/src/op/constant.cpp +++ b/ngraph/core/src/op/constant.cpp @@ -59,7 +59,7 @@ op::Constant::Constant(const shared_ptr& tensor) } op::Constant::Constant(const element::Type& type, - Shape shape, + const Shape& shape, const std::vector& values) : Constant(type, shape) {