Commit 71b6ef81 authored by Tomasz Socha's avatar Tomasz Socha Committed by Scott Cyphers

[SPEC] Rename element_type->destination_type attribute in Convert op (#3823)

parent 8ef5b0ca
......@@ -23,22 +23,22 @@ using namespace ngraph;
constexpr NodeTypeInfo op::Convert::type_info;
op::Convert::Convert(const Output<Node>& arg, const element::Type& element_type)
op::Convert::Convert(const Output<Node>& arg, const element::Type& destination_type)
: Op({arg})
, m_element_type(element_type)
, m_destination_type(destination_type)
{
constructor_validate_and_infer_types();
}
void op::Convert::validate_and_infer_types()
{
set_output_type(0, m_element_type, get_input_partial_shape(0));
set_output_type(0, m_destination_type, get_input_partial_shape(0));
}
shared_ptr<Node> op::Convert::copy_with_new_args(const NodeVector& new_args) const
{
check_new_args_count(this, new_args);
return make_shared<Convert>(new_args.at(0), m_element_type);
return make_shared<Convert>(new_args.at(0), m_destination_type);
}
void op::Convert::generate_adjoints(autodiff::Adjoints& adjoints, const NodeVector& deltas)
......
......@@ -33,23 +33,29 @@ namespace ngraph
Convert() = default;
/// \brief Constructs a conversion operation.
///
/// \param arg Node that produces the input tensor.
/// \param element_type Element type for the output tensor.
Convert(const Output<Node>& arg, const ngraph::element::Type& element_type);
/// \param arg Node that produces the input tensor.
/// \param destination_type Element type for the output tensor.
Convert(const Output<Node>& arg, const ngraph::element::Type& destination_type);
void validate_and_infer_types() override;
virtual std::shared_ptr<Node>
copy_with_new_args(const NodeVector& new_args) const override;
const element::Type& get_convert_element_type() const { return m_element_type; }
void set_convert_element_type(const element::Type& element_type)
const element::Type& get_destination_type() const { return m_destination_type; }
void set_destination_type(const element::Type& destination_type)
{
m_element_type = element_type;
m_destination_type = destination_type;
}
const element::Type& get_convert_element_type() const { return m_destination_type; }
void set_convert_element_type(const element::Type& destination_type)
{
m_destination_type = destination_type;
}
protected:
ngraph::element::Type m_element_type;
ngraph::element::Type m_destination_type;
virtual void generate_adjoints(autodiff::Adjoints& adjoints,
const NodeVector& deltas) override;
};
......
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