From: Anastasia Kuporosova Date: Mon, 24 Aug 2020 11:57:55 +0000 (+0300) Subject: [Python API] Deprecation of DataPtr.creator_layer and DataPtr.input_to properties... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d871a0e05f537d7aa4e3aed8919d61df4001fc32;p=platform%2Fupstream%2Fdldt.git [Python API] Deprecation of DataPtr.creator_layer and DataPtr.input_to properties (#1905) --- diff --git a/inference-engine/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx b/inference-engine/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx index 9260ed7..bda9c6c 100644 --- a/inference-engine/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx +++ b/inference-engine/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx @@ -736,6 +736,8 @@ cdef class DataPtr: @property def creator_layer(self): + warnings.warn("'creator_layer' property of DataPtr class is deprecated and is going to be removed in 2021.2.", + DeprecationWarning) cdef C.CNNLayerWeakPtr _l_ptr cdef IENetLayer creator_layer @@ -752,6 +754,8 @@ cdef class DataPtr: @property def input_to(self): + warnings.warn("'input_to' property of DataPtr class is deprecated and is going to be removed in 2021.2.", + DeprecationWarning) cdef map[string, C.CNNLayerPtr] _l_ptr_map cdef IENetLayer input_to diff --git a/inference-engine/ie_bridges/python/tests/test_DataPtr.py b/inference-engine/ie_bridges/python/tests/test_DataPtr.py index 71a4dc1..73dda3f 100644 --- a/inference-engine/ie_bridges/python/tests/test_DataPtr.py +++ b/inference-engine/ie_bridges/python/tests/test_DataPtr.py @@ -68,11 +68,12 @@ def test_input_to(recwarn): input_to = net.layers['26'].out_data[0].input_to assert len(input_to) == 1 assert input_to[0].name == '27' - assert len(recwarn) == 1 + assert len(recwarn) == 2 assert recwarn.pop(DeprecationWarning) -def test_input_to_via_input_info(): +def test_input_to_via_input_info(recwarn): + warnings.simplefilter("always") ie = IECore() net = ie.read_network(model=test_net_xml, weights=test_net_bin) input_infos = net.input_info @@ -80,6 +81,8 @@ def test_input_to_via_input_info(): input_to = input_infos['data'].input_data.input_to assert len(input_to) == 1 assert input_to[0].name == '19/Fused_Add_' + assert len(recwarn) == 1 + assert recwarn.pop(DeprecationWarning) def test_input_to_via_inputs(recwarn): @@ -91,11 +94,12 @@ def test_input_to_via_inputs(recwarn): input_to = inputs['data'].input_to assert len(input_to) == 1 assert input_to[0].name == '19/Fused_Add_' - assert len(recwarn) == 1 + assert len(recwarn) == 2 assert recwarn.pop(DeprecationWarning) -def test_creator_layer(): +def test_creator_layer(recwarn): + warnings.simplefilter("always") ie = IECore() net = ie.read_network(model=test_net_xml, weights=test_net_bin) outputs = net.outputs @@ -104,3 +108,5 @@ def test_creator_layer(): params = creator_layer.params params['originalLayersNames'] == 'fc_out' params['axis'] == '1' + assert len(recwarn) == 1 + assert recwarn.pop(DeprecationWarning)