Skip to content

Commit 4813cc2

Browse files
shraman-rcmn-robot
authored andcommitted
Internal change
PiperOrigin-RevId: 318132870
1 parent 426f03a commit 4813cc2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

morph_net/tools/configurable_ops.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
VANISHED = 0.0
6060
_DEFAULT_NUM_OUTPUTS_KWARG = 'num_outputs'
6161

62-
_DEFAULT_FUNCTION_DICT = {
62+
DEFAULT_FUNCTION_DICT = {
6363
'fully_connected': contrib_layers.fully_connected,
6464
'conv2d': contrib_layers.conv2d,
6565
'separable_conv2d': contrib_layers.separable_conv2d,
@@ -97,13 +97,13 @@ def get_function_dict(overrides=None):
9797
9898
Args:
9999
overrides: Dict: str -> function. Optionally replace entries in
100-
`_DEFAULT_FUNCTION_DICT`.
100+
`DEFAULT_FUNCTION_DICT`.
101101
102102
Returns:
103103
Dict: function name (str) to function.
104104
"""
105105
overrides = overrides or {}
106-
function_dict = copy.deepcopy(_DEFAULT_FUNCTION_DICT)
106+
function_dict = copy.deepcopy(DEFAULT_FUNCTION_DICT)
107107
function_dict.update(overrides)
108108
return function_dict
109109

@@ -166,7 +166,7 @@ def __init__(self,
166166
integer which is the target NUM_OUTPUTS.
167167
function_dict: A dict between names of ops (strings) and functions
168168
which accept num_outputs as the second argument. If None defaults to
169-
_DEFAULT_FUNCTION_DICT.
169+
DEFAULT_FUNCTION_DICT.
170170
fallback_rule: A `FallbackRule` enum which controls fallback behavior:
171171
* 'pass_through' provided NUM_OUTPUTS is passed to decorated
172172
function (default).
@@ -184,7 +184,7 @@ def __init__(self,
184184
isinstance(fallback_rule, str)):
185185
raise ValueError('fallback_rule must be a string or FallbackRule Enum')
186186

187-
self._function_dict = function_dict or _DEFAULT_FUNCTION_DICT
187+
self._function_dict = function_dict or DEFAULT_FUNCTION_DICT
188188
self._suffix_dict = _SUFFIX_DICT
189189
self._constructed_ops = collections.OrderedDict()
190190
if isinstance(fallback_rule, str):
@@ -299,7 +299,7 @@ def _mask(self, function, suffix, *args, **kwargs):
299299
300300
Args:
301301
function: A callable function to mask the NUM_OUTPUTS parameter from.
302-
Examples for functions are in _DEFAULT_FUNCTION_DICT.
302+
Examples for functions are in DEFAULT_FUNCTION_DICT.
303303
The callable function must accept a NUM_OUTPUTS parameter as the
304304
second argument.
305305
suffix: A string with the suffix of the op name.
@@ -534,7 +534,7 @@ def build_layer_not_affected(inputs):
534534
535535
Args:
536536
configurable_ops: An ConfigurableOps object, to use functions as defined in
537-
'_DEFAULT_FUNCTION_DICT'.
537+
'DEFAULT_FUNCTION_DICT'.
538538
module: A module name to override its functions.
539539
540540
Returns:
@@ -556,7 +556,7 @@ def maybe_setattr(attr):
556556
originals[attr] = getattr(module, attr)
557557
setattr(module, attr, getattr(configurable_ops, attr))
558558

559-
for fn in _DEFAULT_FUNCTION_DICT:
559+
for fn in DEFAULT_FUNCTION_DICT:
560560
maybe_setattr(fn)
561561
return originals
562562

@@ -566,7 +566,7 @@ def recover_module_functions(originals, module):
566566
567567
Args:
568568
originals: Dict of functions to recover. Assumes keys are a contained in
569-
'_DEFAULT_FUNCTION_DICT'.
569+
'DEFAULT_FUNCTION_DICT'.
570570
module: A module name to recover its functions.
571571
572572
"""

0 commit comments

Comments
 (0)