[Opset13][Docs] FakeConvert cpp class docstring (#21324)

* Add code docs

* Remove redundant headers from ref

* Remove redundant eval return

* Empty new line style cleanup

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
This commit is contained in:
Katarzyna Mitrus 2023-12-01 20:37:24 +01:00 committed by GitHub
parent 7d2afa4d38
commit 0a271c136a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 14 deletions

View File

@ -9,17 +9,34 @@
namespace ov {
namespace op {
namespace v13 {
/// \note FakeConvert is an experimental operation and subject to change.
///
/// \brief FakeConvert performs element-wise quantization of input values
/// into a set of values corresponding to a target low-precision type.
///
/// \ingroup ov_ops_cpp_api
class OPENVINO_API FakeConvert : public Op {
public:
OPENVINO_OP("FakeConvert", "opset13");
FakeConvert() = default;
FakeConvert(const ov::Output<ov::Node>& arg,
/// \brief Constructs FakeConvert operation (default shift).
///
/// \param data The input data tensor.
/// \param scale Tensor with a scale factor for the data input.
/// \param destination_type The low precision type to be emulated.
FakeConvert(const ov::Output<ov::Node>& data,
const ov::Output<ov::Node>& scale,
std::string destination_type = "f8e4m3");
FakeConvert(const ov::Output<ov::Node>& arg,
/// \brief Constructs FakeConvert operation.
///
/// \param data The input data tensor.
/// \param scale Tensor with a scale factor for the data input.
/// \param shift Tensor with a shift factor for the data input.
/// \param destination_type The low precision type to be emulated.
FakeConvert(const ov::Output<ov::Node>& data,
const ov::Output<ov::Node>& scale,
const ov::Output<ov::Node>& shift,
std::string destination_type = "f8e4m3");

View File

@ -4,17 +4,11 @@
#pragma once
#include <algorithm>
#include <cmath>
#include <numeric>
#include <vector>
#include "openvino/reference/add.hpp"
#include "openvino/reference/autobroadcast_binop.hpp"
#include "openvino/reference/convert.hpp"
#include "openvino/reference/divide.hpp"
#include "openvino/reference/multiply.hpp"
#include "openvino/reference/subtract.hpp"
namespace ov {
namespace reference {

View File

@ -47,19 +47,19 @@ struct Evaluate : element::NoAction<bool> {
};
} // namespace fake_convert_details
FakeConvert::FakeConvert(const ov::Output<ov::Node>& arg,
FakeConvert::FakeConvert(const ov::Output<ov::Node>& data,
const ov::Output<ov::Node>& scale,
std::string destination_type)
: Op({arg, scale}),
: Op({data, scale}),
m_destination_type(std::move(destination_type)) {
constructor_validate_and_infer_types();
}
FakeConvert::FakeConvert(const ov::Output<ov::Node>& arg,
FakeConvert::FakeConvert(const ov::Output<ov::Node>& data,
const ov::Output<ov::Node>& scale,
const ov::Output<ov::Node>& shift,
std::string destination_type)
: Op({arg, scale, shift}),
: Op({data, scale, shift}),
m_destination_type(std::move(destination_type)) {
constructor_validate_and_infer_types();
}
@ -139,8 +139,6 @@ bool FakeConvert::evaluate(ov::TensorVector& outputs, const ov::TensorVector& in
outputs,
inputs,
get_destination_type());
return true;
}
} // namespace v13
} // namespace op