Skip to content

Commit 9cd848a

Browse files
authored
Fix typos in frontends and few obvious issues in onnx and pytorch (#33853)
### Details: - *Fix typos in frontends* - *Fix obvious problems in ONNX and PyTorch frontends* --------- Signed-off-by: Maxim Vafin <maxim.vafin@intel.com>
1 parent 759d83e commit 9cd848a

File tree

143 files changed

+464
-345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+464
-345
lines changed

src/frontends/common/include/openvino/frontend/exception.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ class FRONTEND_API NotImplementedFailure : public AssertFailure {
7676
/// \param cond Condition to check
7777
/// \param ... Additional error message info to be added to the error message via the `<<`
7878
/// stream-insertion operator. Note that the expressions here will be evaluated lazily,
79-
/// i.e., only if the `cond` evalutes to `false`.
79+
/// i.e., only if the `cond` evaluates to `false`.
8080
/// \throws ::ov::frontend::GeneralFailure if `cond` is false.
8181
#define FRONT_END_GENERAL_CHECK(...) OPENVINO_ASSERT_HELPER(::ov::frontend::GeneralFailure, "", __VA_ARGS__)
8282

8383
/// \brief Macro to check whether a boolean condition holds.
8484
/// \param cond Condition to check
8585
/// \param ... Additional error message info to be added to the error message via the `<<`
8686
/// stream-insertion operator. Note that the expressions here will be evaluated lazily,
87-
/// i.e., only if the `cond` evalutes to `false`.
87+
/// i.e., only if the `cond` evaluates to `false`.
8888
/// \throws ::ov::frontend::InitializationFailure if `cond` is false.
8989
#define FRONT_END_INITIALIZATION_CHECK(...) \
9090
OPENVINO_ASSERT_HELPER(::ov::frontend::InitializationFailure, "", __VA_ARGS__)
@@ -93,7 +93,7 @@ class FRONTEND_API NotImplementedFailure : public AssertFailure {
9393
/// \param cond Condition to check
9494
/// \param ... Additional error message info to be added to the error message via the `<<`
9595
/// stream-insertion operator. Note that the expressions here will be evaluated lazily,
96-
/// i.e., only if the `cond` evalutes to `false`.
96+
/// i.e., only if the `cond` evaluates to `false`.
9797
/// \throws ::ov::frontend::OpConversionFailure if `cond` is false.
9898
#define FRONT_END_OP_CONVERSION_CHECK(...) OPENVINO_ASSERT_HELPER(::ov::frontend::OpConversionFailure, "", __VA_ARGS__)
9999

src/frontends/common/src/frontend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ std::shared_ptr<Model> FrontEnd::decode(const InputModel::Ptr& model) const {
7373

7474
void FrontEnd::normalize(const std::shared_ptr<Model>& model) const {
7575
FRONT_END_CHECK_IMPLEMENTED(m_actual, normalize);
76-
FRONTEND_CALL_STATEMENT("Normalizing model", m_actual->normalize(model);)
76+
FRONTEND_CALL_STATEMENT("Normalizing model", m_actual->normalize(model))
7777
}
7878

7979
void FrontEnd::add_extension(const std::shared_ptr<ov::Extension>& extension) {
@@ -106,7 +106,7 @@ std::string FrontEnd::get_name() const {
106106
if (!m_actual) {
107107
return {};
108108
}
109-
FRONTEND_RETURN_STATEMENT("Getting frontend name", m_actual->get_name();)
109+
FRONTEND_RETURN_STATEMENT("Getting frontend name", m_actual->get_name())
110110
}
111111

112112
void FrontEnd::validate_path(const std::filesystem::path& path) const {

src/frontends/jax/src/utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const std::string& get_jax_prefix();
2929
/// \param COND Condition to check
3030
/// \param ... Additional error message info to be added to the error message via the `<<`
3131
/// stream-insertion operator. Note that the expressions here will be evaluated lazily,
32-
/// i.e., only if the `cond` evalutes to `false`.
32+
/// i.e., only if the `cond` evaluates to `false`.
3333
/// \throws ::ov::frontend::OpConversionFailure if `cond` is false.
3434
#ifndef JAX_OP_CONVERSION_CHECK
3535
# define JAX_OP_CONVERSION_CHECK(COND, ...) \

src/frontends/onnx/docs/check_supported_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def run_in_ci():
6363
if line.count('|') == 6:
6464
table_line += 1
6565
if table_line > 2:
66-
row = [cell.strip() for cell in line.split('|')] # Split line by "|" delimeter and remove spaces
66+
row = [cell.strip() for cell in line.split('|')] # Split line by "|" delimiter and remove spaces
6767
domain = row[1]
6868
if not domain in ops:
6969
ops[domain] = {}

src/frontends/onnx/frontend/src/core/attribute.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,25 @@ inline float get_value(const AttributeProto& attribute) {
4646

4747
template <>
4848
inline std::vector<float> get_value(const AttributeProto& attribute) {
49+
#if defined(_MSC_VER)
50+
# pragma warning(push)
51+
# pragma warning(disable : 4244)
52+
#endif
4953
switch (attribute.type()) {
5054
case AttributeProto_AttributeType::AttributeProto_AttributeType_INT:
5155
return {static_cast<float>(attribute.i())};
5256
case AttributeProto_AttributeType::AttributeProto_AttributeType_INTS:
53-
return {std::begin(attribute.floats()), std::end(attribute.floats())};
57+
return {std::begin(attribute.ints()), std::end(attribute.ints())};
5458
case AttributeProto_AttributeType::AttributeProto_AttributeType_FLOAT:
5559
return {attribute.f()};
5660
case AttributeProto_AttributeType::AttributeProto_AttributeType_FLOATS:
5761
return {std::begin(attribute.floats()), std::end(attribute.floats())};
5862
default:
5963
ONNX_INVALID_ATTR(attribute.type(), "INT, INTS, FLOAT, FLOATS");
6064
}
65+
#if defined(_MSC_VER)
66+
# pragma warning(pop)
67+
#endif
6168
}
6269

6370
template <>

src/frontends/onnx/frontend/src/core/graph.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ class Graph : public std::enable_shared_from_this<Graph> {
9797
/// cache.
9898
class Subgraph : public Graph {
9999
public:
100-
/// \brief Subgraph a GraphCache class object.
100+
/// \brief Subgraph holds a GraphCache class object.
101101
///
102102
/// \param[in] model The ONNX model object.
103103
/// \param[in] parent_graph The reference to the parent graph.
104104
Subgraph(const std::shared_ptr<ModelProto>& model, Graph* parent_graph);
105105

106-
/// \brief Return nodes which are on the edge the subgraph and the parent graph.
106+
/// \brief Return nodes which are on the edge of the subgraph and the parent graph.
107107
/// \return Vector of edge nodes from parent scope.
108108
const std::vector<ov::Output<ov::Node>> get_inputs_from_parent() const;
109109

src/frontends/onnx/frontend/src/core/graph_cache.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,29 @@ class GraphCache {
2020
///
2121
/// \note GraphCache takes ownership of the node.
2222
///
23-
/// \param[in] name The name of node added to the cache.
23+
/// \param[in] name The name of the node added to the cache.
2424
/// \param[in] node The node added to the cache.
2525
void emplace_node(const std::string& name, ov::Output<ov::Node>&& node);
2626

2727
/// \brief Remove node from the cache
2828
///
29-
/// \param[in] name The name of node to be removed
29+
/// \param[in] name The name of the node to be removed
3030
void remove_node(const std::string& name);
3131

3232
/// \brief Get the node from the cache
3333
///
34-
/// \note If the node is not found the ov::Exception is thrown.
34+
/// \note If the node is not found, an ov::Exception is thrown.
3535
///
3636
/// \param[in] name The name of the node.
3737
///
3838
/// \return The node named `name`.
3939
virtual ov::Output<ov::Node> get_node(const std::string& name) const;
4040

41-
/// \brief Return true if the node named `name` exist in the cache.
41+
/// \brief Return true if the node named `name` exists in the cache.
4242
///
4343
/// \param[in] name The name of the node.
4444
///
45-
/// \return true if the node named `name` exist in the cache, false otherwise.
45+
/// \return true if the node named `name` exists in the cache, false otherwise.
4646
virtual bool contains(const std::string& name) const;
4747

4848
virtual ~GraphCache() = default;

src/frontends/onnx/frontend/src/core/graph_iterator_proto.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class GraphIteratorProto : public ov::frontend::onnx::GraphIterator {
5454
GraphIteratorProtoMemoryManagementMode m_mode;
5555
// This is used for keeping MMAP cache handles
5656
MappedMemoryHandles m_mmap_cache;
57-
// This is used for keeping a readed external data without MMAP
57+
// This is used for keeping external data read without MMAP
5858
LocalStreamHandles m_stream_cache;
5959
LocalMemoryHandles m_data_holder;
6060

src/frontends/onnx/frontend/src/detail/subgraph_extraction.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct SubgraphExtractor {
3030

3131
/// \brief Adds new inputs to the graph and connects them to the nodes indicated by
3232
/// the provided input edges.
33-
/// \param merge_inputs Flag indicating wheteher new inputs are generated for each input edge (false)
33+
/// \param merge_inputs Flag indicating whether new inputs are generated for each input edge (false)
3434
/// or there is only one input created for provided edges (true)
3535
void add_new_inputs(const std::vector<InputEdge>& new_inputs, const bool merge_inputs = false);
3636

src/frontends/onnx/frontend/src/edge_mapper.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class EdgeMapper {
2929

3030
/// \brief Creates an edge mapper based on a GraphProto object.
3131
///
32-
/// \note If state of graph_proto will be changed, the information from edge mapper
32+
/// \note If the state of graph_proto changes, the information from the edge mapper
3333
/// is outdated. In such a case the update method should be called.
3434
///
3535
/// \param graph_proto Reference to a GraphProto object.
@@ -39,37 +39,37 @@ class EdgeMapper {
3939
/// and an input (input name or input index).
4040
///
4141
/// \note The node name can be ambiguous (many ONNX nodes can have the same name).
42-
/// In such a case the algorthim tries to match the given node name
42+
/// In such a case the algorithm tries to match the given node name
4343
/// with the input name (providing an input index is not enough).
4444
/// If a unique edge is found, it will be returned.
4545
/// If InputEdge cannot be determined based on parameter values an
46-
/// ov:Exception will be thrown.
46+
/// ov::Exception will be thrown.
4747
///
4848
/// \param node An EditorNode helper structure created based on a node name
4949
/// or a node output name.
5050
///
51-
/// \param input An EditorInput helper structure created based on a input name
52-
/// or a input index.
51+
/// \param input An EditorInput helper structure created based on an input name
52+
/// or an input index.
5353
InputEdge find_input_edge(const EditorNode& node, const EditorInput& input) const;
5454

5555
/// \brief Returns an OutputEdge based on a node (node name or output name)
5656
/// and an output (output name or output index).
5757
///
5858
/// \note The node name can be ambiguous (many ONNX nodes can have the same name).
59-
/// In such a case the algorthim will try to match the given node name
59+
/// In such a case the algorithm will try to match the given node name
6060
/// with the output name (providing an output index is not enough).
61-
/// If after such operation a found edge is unique, it is returned.
61+
/// If the found edge is unique after such an operation, it is returned.
6262
/// If OutputEdge cannot be determined based on given params an
6363
/// ov::Exception is thrown.
6464
///
6565
/// \param node An EditorNode helper structure created based on a node name
6666
/// or a node output name.
6767
///
68-
/// \param output An EditorOutput helper structure created based on a output name
69-
/// or a output index.
68+
/// \param output An EditorOutput helper structure created based on an output name
69+
/// or an output index.
7070
OutputEdge find_output_edge(const EditorNode& node, const EditorOutput& output) const;
7171

72-
/// \brief Returns an OutputEdge based on a output name.
72+
/// \brief Returns an OutputEdge based on an output name.
7373
///
7474
/// \note The output name guarantees the uniqueness of the edge.
7575
///

0 commit comments

Comments
 (0)