MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / rename_weight_or_biases

Function rename_weight_or_biases

tensorlayer/files/utils.py:2801–2820  ·  view source on GitHub ↗
(variable_name)

Source from the content-addressed store, hash-verified

2799
2800
2801def rename_weight_or_biases(variable_name):
2802 if variable_name is None:
2803 return variable_name
2804 split_var = variable_name.split('/')
2805
2806 str_temp = ''
2807 for i in range(len(split_var)):
2808 if 'w' in split_var[i]:
2809 split_var[i] = 'filters:0'
2810 elif 'b' in split_var[i]:
2811 split_var[i] = 'biases:0'
2812 else:
2813 pass
2814
2815 if i < len(split_var) - 1:
2816 str_temp = str_temp + split_var[i] + '/'
2817 else:
2818 str_temp = str_temp + split_var[i]
2819
2820 return str_temp
2821
2822
2823def load_and_assign_ckpt(model_dir, network=None, skip=True):

Callers 1

ckpt_to_npz_dictFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…