[Python API] Deprecation of DataPtr.creator_layer and DataPtr.input_to properties (#1905)

This commit is contained in:
Anastasia Kuporosova 2020-08-24 14:57:55 +03:00 committed by GitHub
parent cb72684388
commit d871a0e05f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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)