MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / map_common_tfargs

Function map_common_tfargs

tensorpack/models/tflayer.py:15–30  ·  view source on GitHub ↗
(kwargs)

Source from the content-addressed store, hash-verified

13
14
15def map_common_tfargs(kwargs):
16 df = kwargs.pop('data_format', None)
17 if df is not None:
18 df = get_data_format(df, keras_mode=True)
19 kwargs['data_format'] = df
20
21 old_nl = kwargs.pop('nl', None)
22 if old_nl is not None:
23 kwargs['activation'] = lambda x, name=None: old_nl(x, name=name)
24
25 if 'W_init' in kwargs:
26 kwargs['kernel_initializer'] = kwargs.pop('W_init')
27
28 if 'b_init' in kwargs:
29 kwargs['bias_initializer'] = kwargs.pop('b_init')
30 return kwargs
31
32
33def convert_to_tflayer_args(args_names, name_mapping):

Callers 1

decorated_funcFunction · 0.85

Calls 1

get_data_formatFunction · 0.85

Tested by

no test coverage detected