Skip to content

Commit 57bc02b

Browse files
ilya-lavrenovakuporos
authored andcommitted
Removed name from ngraph tensors (openvinotoolkit#6446)
1 parent 1d567b3 commit 57bc02b

File tree

4 files changed

+13
-55
lines changed

4 files changed

+13
-55
lines changed

ngraph/core/include/ngraph/runtime/host_tensor.hpp

+4-11
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,10 @@ namespace ngraph
2525
class NGRAPH_API HostTensor : public ngraph::runtime::Tensor
2626
{
2727
public:
28-
HostTensor(const element::Type& element_type,
29-
const Shape& shape,
30-
void* memory_pointer,
31-
const std::string& name = "");
32-
HostTensor(const element::Type& element_type,
33-
const Shape& shape,
34-
const std::string& name = "");
35-
HostTensor(const element::Type& element_type,
36-
const PartialShape& partial_shape,
37-
const std::string& name = "");
38-
HostTensor(const std::string& name = "");
28+
HostTensor(const element::Type& element_type, const Shape& shape, void* memory_pointer);
29+
HostTensor(const element::Type& element_type, const Shape& shape);
30+
HostTensor(const element::Type& element_type, const PartialShape& partial_shape);
31+
HostTensor();
3932
explicit HostTensor(const Output<Node>&);
4033
explicit HostTensor(const std::shared_ptr<op::v0::Constant>& constant);
4134
virtual ~HostTensor() override;

ngraph/core/include/ngraph/runtime/tensor.hpp

-20
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,6 @@ namespace ngraph
5454
NGRAPH_DEPRECATED("Only output ports have names")
5555
const std::string& get_name() const;
5656

57-
/// \brief Get the stale value of the tensor. A tensor is stale if its data is
58-
/// changed.
59-
/// \return true if there is new data in this tensor
60-
NGRAPH_DEPRECATED("This method is deprecated and will be removed in 2022.1 release")
61-
bool get_stale() const;
62-
63-
/// \brief Set the stale value of the tensor. A tensor is stale if its data is
64-
/// changed.
65-
NGRAPH_DEPRECATED("This method is deprecated and will be removed in 2022.1 release")
66-
void set_stale(bool val);
67-
6857
/// \brief Write bytes directly into the tensor
6958
/// \param p Pointer to source of data
7059
/// \param n Number of bytes to write, must be integral number of elements.
@@ -75,15 +64,6 @@ namespace ngraph
7564
/// \param n Number of bytes to read, must be integral number of elements.
7665
virtual void read(void* p, size_t n) const = 0;
7766

78-
/// \brief check tensor for new data, call may block.
79-
/// backends may use this to ensure tensor is updated (eg: lazy eval).
80-
NGRAPH_DEPRECATED("This method is deprecated and will be removed in 2022.1 release")
81-
virtual void wait_for_read_ready() {}
82-
/// \brief notify tensor of new data, call may block.
83-
/// backends may use this as indication of new data in tensor.
84-
NGRAPH_DEPRECATED("This method is deprecated and will be removed in 2022.1 release")
85-
virtual void wait_for_write_ready() {}
86-
8767
protected:
8868
std::shared_ptr<ngraph::descriptor::Tensor> m_descriptor;
8969
bool m_stale;

ngraph/core/src/runtime/host_tensor.cpp

+9-14
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ static const size_t alignment = 64;
1616

1717
runtime::HostTensor::HostTensor(const ngraph::element::Type& element_type,
1818
const Shape& shape,
19-
void* memory_pointer,
20-
const string& name)
21-
: runtime::Tensor(std::make_shared<ngraph::descriptor::Tensor>(element_type, shape, name))
19+
void* memory_pointer)
20+
: runtime::Tensor(std::make_shared<ngraph::descriptor::Tensor>(element_type, shape, ""))
2221
, m_memory_pointer(memory_pointer)
2322
{
2423
if (get_partial_shape().is_static() && get_element_type().is_static())
@@ -31,31 +30,27 @@ runtime::HostTensor::HostTensor(const ngraph::element::Type& element_type,
3130
}
3231
}
3332

34-
runtime::HostTensor::HostTensor(const element::Type& element_type,
35-
const Shape& shape,
36-
const std::string& name)
37-
: HostTensor(element_type, shape, nullptr, name)
33+
runtime::HostTensor::HostTensor(const element::Type& element_type, const Shape& shape)
34+
: HostTensor(element_type, shape, nullptr)
3835
{
3936
}
4037

4138
runtime::HostTensor::HostTensor(const element::Type& element_type,
42-
const PartialShape& partial_shape,
43-
const std::string& name)
44-
: runtime::Tensor(
45-
std::make_shared<ngraph::descriptor::Tensor>(element_type, partial_shape, name))
39+
const PartialShape& partial_shape)
40+
: runtime::Tensor(std::make_shared<ngraph::descriptor::Tensor>(element_type, partial_shape, ""))
4641
, m_buffer_size(0)
4742
{
4843
// Defer allocation until ptr is requested
4944
}
5045

51-
runtime::HostTensor::HostTensor(const std::string& name)
46+
runtime::HostTensor::HostTensor()
5247
: HostTensor(element::dynamic, PartialShape::dynamic())
5348
{
5449
}
5550

5651
NGRAPH_SUPPRESS_DEPRECATED_START
5752
runtime::HostTensor::HostTensor(const Output<Node>& value)
58-
: HostTensor(value.get_element_type(), value.get_partial_shape(), value.get_tensor().get_name())
53+
: HostTensor(value.get_element_type(), value.get_partial_shape())
5954
{
6055
}
6156
NGRAPH_SUPPRESS_DEPRECATED_END
@@ -93,7 +88,7 @@ void runtime::HostTensor::allocate_buffer()
9388

9489
NGRAPH_SUPPRESS_DEPRECATED_START
9590
runtime::HostTensor::HostTensor(const std::shared_ptr<op::v0::Constant>& constant)
96-
: HostTensor(constant->output(0).get_tensor().get_name())
91+
: HostTensor()
9792
{
9893
initialize(constant);
9994
}

ngraph/core/src/runtime/tensor.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,3 @@ const std::string& runtime::Tensor::get_name() const
4141
return m_descriptor->get_name();
4242
NGRAPH_SUPPRESS_DEPRECATED_END
4343
}
44-
45-
bool runtime::Tensor::get_stale() const
46-
{
47-
return m_stale;
48-
}
49-
50-
void runtime::Tensor::set_stale(bool val)
51-
{
52-
m_stale = val;
53-
}

0 commit comments

Comments
 (0)