Removed name from ngraph tensors (#6446)
This commit is contained in:
parent
ebd86e31e8
commit
344e063002
@ -25,17 +25,10 @@ namespace ngraph
|
|||||||
class NGRAPH_API HostTensor : public ngraph::runtime::Tensor
|
class NGRAPH_API HostTensor : public ngraph::runtime::Tensor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HostTensor(const element::Type& element_type,
|
HostTensor(const element::Type& element_type, const Shape& shape, void* memory_pointer);
|
||||||
const Shape& shape,
|
HostTensor(const element::Type& element_type, const Shape& shape);
|
||||||
void* memory_pointer,
|
HostTensor(const element::Type& element_type, const PartialShape& partial_shape);
|
||||||
const std::string& name = "");
|
HostTensor();
|
||||||
HostTensor(const element::Type& element_type,
|
|
||||||
const Shape& shape,
|
|
||||||
const std::string& name = "");
|
|
||||||
HostTensor(const element::Type& element_type,
|
|
||||||
const PartialShape& partial_shape,
|
|
||||||
const std::string& name = "");
|
|
||||||
HostTensor(const std::string& name = "");
|
|
||||||
explicit HostTensor(const Output<Node>&);
|
explicit HostTensor(const Output<Node>&);
|
||||||
explicit HostTensor(const std::shared_ptr<op::v0::Constant>& constant);
|
explicit HostTensor(const std::shared_ptr<op::v0::Constant>& constant);
|
||||||
virtual ~HostTensor() override;
|
virtual ~HostTensor() override;
|
||||||
|
@ -54,17 +54,6 @@ namespace ngraph
|
|||||||
NGRAPH_DEPRECATED("Only output ports have names")
|
NGRAPH_DEPRECATED("Only output ports have names")
|
||||||
const std::string& get_name() const;
|
const std::string& get_name() const;
|
||||||
|
|
||||||
/// \brief Get the stale value of the tensor. A tensor is stale if its data is
|
|
||||||
/// changed.
|
|
||||||
/// \return true if there is new data in this tensor
|
|
||||||
NGRAPH_DEPRECATED("This method is deprecated and will be removed in 2022.1 release")
|
|
||||||
bool get_stale() const;
|
|
||||||
|
|
||||||
/// \brief Set the stale value of the tensor. A tensor is stale if its data is
|
|
||||||
/// changed.
|
|
||||||
NGRAPH_DEPRECATED("This method is deprecated and will be removed in 2022.1 release")
|
|
||||||
void set_stale(bool val);
|
|
||||||
|
|
||||||
/// \brief Write bytes directly into the tensor
|
/// \brief Write bytes directly into the tensor
|
||||||
/// \param p Pointer to source of data
|
/// \param p Pointer to source of data
|
||||||
/// \param n Number of bytes to write, must be integral number of elements.
|
/// \param n Number of bytes to write, must be integral number of elements.
|
||||||
@ -75,15 +64,6 @@ namespace ngraph
|
|||||||
/// \param n Number of bytes to read, must be integral number of elements.
|
/// \param n Number of bytes to read, must be integral number of elements.
|
||||||
virtual void read(void* p, size_t n) const = 0;
|
virtual void read(void* p, size_t n) const = 0;
|
||||||
|
|
||||||
/// \brief check tensor for new data, call may block.
|
|
||||||
/// backends may use this to ensure tensor is updated (eg: lazy eval).
|
|
||||||
NGRAPH_DEPRECATED("This method is deprecated and will be removed in 2022.1 release")
|
|
||||||
virtual void wait_for_read_ready() {}
|
|
||||||
/// \brief notify tensor of new data, call may block.
|
|
||||||
/// backends may use this as indication of new data in tensor.
|
|
||||||
NGRAPH_DEPRECATED("This method is deprecated and will be removed in 2022.1 release")
|
|
||||||
virtual void wait_for_write_ready() {}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::shared_ptr<ngraph::descriptor::Tensor> m_descriptor;
|
std::shared_ptr<ngraph::descriptor::Tensor> m_descriptor;
|
||||||
bool m_stale;
|
bool m_stale;
|
||||||
|
@ -16,9 +16,8 @@ static const size_t alignment = 64;
|
|||||||
|
|
||||||
runtime::HostTensor::HostTensor(const ngraph::element::Type& element_type,
|
runtime::HostTensor::HostTensor(const ngraph::element::Type& element_type,
|
||||||
const Shape& shape,
|
const Shape& shape,
|
||||||
void* memory_pointer,
|
void* memory_pointer)
|
||||||
const string& name)
|
: runtime::Tensor(std::make_shared<ngraph::descriptor::Tensor>(element_type, shape, ""))
|
||||||
: runtime::Tensor(std::make_shared<ngraph::descriptor::Tensor>(element_type, shape, name))
|
|
||||||
, m_memory_pointer(memory_pointer)
|
, m_memory_pointer(memory_pointer)
|
||||||
{
|
{
|
||||||
if (get_partial_shape().is_static() && get_element_type().is_static())
|
if (get_partial_shape().is_static() && get_element_type().is_static())
|
||||||
@ -31,31 +30,27 @@ runtime::HostTensor::HostTensor(const ngraph::element::Type& element_type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime::HostTensor::HostTensor(const element::Type& element_type,
|
runtime::HostTensor::HostTensor(const element::Type& element_type, const Shape& shape)
|
||||||
const Shape& shape,
|
: HostTensor(element_type, shape, nullptr)
|
||||||
const std::string& name)
|
|
||||||
: HostTensor(element_type, shape, nullptr, name)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime::HostTensor::HostTensor(const element::Type& element_type,
|
runtime::HostTensor::HostTensor(const element::Type& element_type,
|
||||||
const PartialShape& partial_shape,
|
const PartialShape& partial_shape)
|
||||||
const std::string& name)
|
: runtime::Tensor(std::make_shared<ngraph::descriptor::Tensor>(element_type, partial_shape, ""))
|
||||||
: runtime::Tensor(
|
|
||||||
std::make_shared<ngraph::descriptor::Tensor>(element_type, partial_shape, name))
|
|
||||||
, m_buffer_size(0)
|
, m_buffer_size(0)
|
||||||
{
|
{
|
||||||
// Defer allocation until ptr is requested
|
// Defer allocation until ptr is requested
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime::HostTensor::HostTensor(const std::string& name)
|
runtime::HostTensor::HostTensor()
|
||||||
: HostTensor(element::dynamic, PartialShape::dynamic())
|
: HostTensor(element::dynamic, PartialShape::dynamic())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
NGRAPH_SUPPRESS_DEPRECATED_START
|
NGRAPH_SUPPRESS_DEPRECATED_START
|
||||||
runtime::HostTensor::HostTensor(const Output<Node>& value)
|
runtime::HostTensor::HostTensor(const Output<Node>& value)
|
||||||
: HostTensor(value.get_element_type(), value.get_partial_shape(), value.get_tensor().get_name())
|
: HostTensor(value.get_element_type(), value.get_partial_shape())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
NGRAPH_SUPPRESS_DEPRECATED_END
|
NGRAPH_SUPPRESS_DEPRECATED_END
|
||||||
@ -93,7 +88,7 @@ void runtime::HostTensor::allocate_buffer()
|
|||||||
|
|
||||||
NGRAPH_SUPPRESS_DEPRECATED_START
|
NGRAPH_SUPPRESS_DEPRECATED_START
|
||||||
runtime::HostTensor::HostTensor(const std::shared_ptr<op::v0::Constant>& constant)
|
runtime::HostTensor::HostTensor(const std::shared_ptr<op::v0::Constant>& constant)
|
||||||
: HostTensor(constant->output(0).get_tensor().get_name())
|
: HostTensor()
|
||||||
{
|
{
|
||||||
initialize(constant);
|
initialize(constant);
|
||||||
}
|
}
|
||||||
|
@ -41,13 +41,3 @@ const std::string& runtime::Tensor::get_name() const
|
|||||||
return m_descriptor->get_name();
|
return m_descriptor->get_name();
|
||||||
NGRAPH_SUPPRESS_DEPRECATED_END
|
NGRAPH_SUPPRESS_DEPRECATED_END
|
||||||
}
|
}
|
||||||
|
|
||||||
bool runtime::Tensor::get_stale() const
|
|
||||||
{
|
|
||||||
return m_stale;
|
|
||||||
}
|
|
||||||
|
|
||||||
void runtime::Tensor::set_stale(bool val)
|
|
||||||
{
|
|
||||||
m_stale = val;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user