33# Use of this source code is governed by a BSD-3-clause license that can be
44# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
55
6- from .spec_inspection_utils import *
6+ from .spec_inspection_utils import _get_feature_description_summary , \
7+ _summarize_neural_network_spec_code_style , \
8+ _summarize_neural_network_spec
79
10+ from coremltools .models ._deprecation import deprecated
811
12+ @deprecated
913def print_network_spec_parameter_info_style (mlmodel_spec , interface_only = False ):
14+ return _print_network_spec_parameter_info_style (mlmodel_spec , interface_only = interface_only )
15+
16+ def _print_network_spec_parameter_info_style (mlmodel_spec , interface_only = False ):
1017 """ Print the network information summary.
1118 Args:
1219 mlmodel_spec : the mlmodel spec
1320 interface_only : Shows only the input and output of the network
1421 """
15- inputs , outputs , layers_info = summarize_neural_network_spec (mlmodel_spec )
22+ inputs , outputs , layers_info = _summarize_neural_network_spec (mlmodel_spec )
1623
1724 print ('Inputs:' )
1825 for i in inputs :
@@ -41,16 +48,19 @@ def print_network_spec_parameter_info_style(mlmodel_spec, interface_only=False):
4148
4249 print ('\n ' )
4350
44-
51+ @ deprecated
4552def print_network_spec_coding_style (mlmodel_spec , interface_only = False ):
53+ return _print_network_spec_coding_style (mlmodel_spec , interface_only = interface_only )
54+
55+ def _print_network_spec_coding_style (mlmodel_spec , interface_only = False ):
4656 """
4757 Args:
4858 mlmodel_spec : the mlmodel spec
4959 interface_only : Shows only the input and output of the network
5060 """
5161
52- inputs = [(blob .name , get_feature_description_summary (blob )) for blob in mlmodel_spec .description .input ]
53- outputs = [(blob .name , get_feature_description_summary (blob )) for blob in mlmodel_spec .description .output ]
62+ inputs = [(blob .name , _get_feature_description_summary (blob )) for blob in mlmodel_spec .description .input ]
63+ outputs = [(blob .name , _get_feature_description_summary (blob )) for blob in mlmodel_spec .description .output ]
5464
5565 input_names = []
5666 print ('Inputs:' )
@@ -83,7 +93,7 @@ def print_network_spec_coding_style(mlmodel_spec, interface_only=False):
8393 return
8494
8595 print ('\n ' )
86- summarize_neural_network_spec_code_style (nn_spec , input_names = input_names , output_names = output_names )
96+ _summarize_neural_network_spec_code_style (nn_spec , input_names = input_names , output_names = output_names )
8797
8898
8999def print_network_spec (mlmodel_spec , interface_only = False , style = '' ):
@@ -95,6 +105,6 @@ def print_network_spec(mlmodel_spec, interface_only=False, style=''):
95105 """
96106
97107 if style == 'coding' :
98- print_network_spec_coding_style (mlmodel_spec , interface_only = interface_only )
108+ _print_network_spec_coding_style (mlmodel_spec , interface_only = interface_only )
99109 else :
100- print_network_spec_parameter_info_style (mlmodel_spec , interface_only = interface_only )
110+ _print_network_spec_parameter_info_style (mlmodel_spec , interface_only = interface_only )
0 commit comments