diff --git a/src/bindings/python/src/pyopenvino/graph/model.cpp b/src/bindings/python/src/pyopenvino/graph/model.cpp index f666fcd8e76..52be0daf714 100644 --- a/src/bindings/python/src/pyopenvino/graph/model.cpp +++ b/src/bindings/python/src/pyopenvino/graph/model.cpp @@ -1004,7 +1004,9 @@ void regclass_graph_Model(py::module m) { return reinterpret_cast(&self); }, R"( - Returns raw address of the Model object. + Returns a raw address of the Model object from C++. + + Use this function in order to compare underlying C++ addresses instead of using `__eq__` in Python. :return: a raw address of the Model object. :rtype: int diff --git a/src/bindings/python/tests/test_runtime/test_model.py b/src/bindings/python/tests/test_runtime/test_model.py index 90e9ff4e4bb..9806fb1b0e0 100644 --- a/src/bindings/python/tests/test_runtime/test_model.py +++ b/src/bindings/python/tests/test_runtime/test_model.py @@ -657,3 +657,12 @@ def test_model_add_remove_result_parameter_sink(): assert ["Assign"] == [sink.get_type_name() for sink in assign_nodes] model.remove_sink(assign) assert len(model.sinks) == 0 + + +def test_model_get_raw_address(): + model = generate_add_model() + model_with_same_addr = model + model_different = generate_add_model() + + assert model._get_raw_address() == model_with_same_addr._get_raw_address() + assert model._get_raw_address() != model_different._get_raw_address()