Commit 8156e3e0 authored by Yixing Lao's avatar Yixing Lao Committed by Avijit

operator overloading as a free function (#142)

parent 332c4833
...@@ -20,9 +20,9 @@ using namespace ngraph; ...@@ -20,9 +20,9 @@ using namespace ngraph;
using namespace ngraph::descriptor; using namespace ngraph::descriptor;
Tensor::Tensor(const element::Type& element_type, Tensor::Tensor(const element::Type& element_type,
PrimaryTensorView* primary_tensor_view, PrimaryTensorView* primary_tensor_view,
const Node* parent, const Node* parent,
size_t value_index) size_t value_index)
: m_element_type(element_type) : m_element_type(element_type)
, m_primary_tensor_view(primary_tensor_view) , m_primary_tensor_view(primary_tensor_view)
, m_is_output{parent->is_output()} , m_is_output{parent->is_output()}
...@@ -59,7 +59,7 @@ size_t Tensor::get_pool_offset() const ...@@ -59,7 +59,7 @@ size_t Tensor::get_pool_offset() const
return m_pool_offset; return m_pool_offset;
} }
std::ostream& descriptor::operator<<(std::ostream& out, const Tensor& tensor) std::ostream& operator<<(std::ostream& out, const Tensor& tensor)
{ {
out << "Tensor(" << tensor.get_name() << ")"; out << "Tensor(" << tensor.get_name() << ")";
return out; return out;
......
...@@ -59,8 +59,6 @@ public: ...@@ -59,8 +59,6 @@ public:
void set_pool_offset(size_t); void set_pool_offset(size_t);
size_t get_pool_offset() const; size_t get_pool_offset() const;
friend std::ostream& operator<<(std::ostream&, const Tensor&);
protected: protected:
const element::Type& m_element_type; const element::Type& m_element_type;
PrimaryTensorView* m_primary_tensor_view; PrimaryTensorView* m_primary_tensor_view;
...@@ -72,3 +70,5 @@ protected: ...@@ -72,3 +70,5 @@ protected:
size_t m_size; size_t m_size;
size_t m_pool_offset; size_t m_pool_offset;
}; };
std::ostream& operator<<(std::ostream&, const ngraph::descriptor::Tensor&);
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