MCPcopy
hub / github.com/bojone/bert4keras / simplify

Method simplify

bert4keras/models.py:238–245  ·  view source on GitHub ↗

将list中的None过滤掉

(self, inputs)

Source from the content-addressed store, hash-verified

236 return keras.initializers.TruncatedNormal(stddev=0.02)
237
238 def simplify(self, inputs):
239 """将list中的None过滤掉
240 """
241 inputs = [i for i in inputs if i is not None]
242 if len(inputs) == 1:
243 inputs = inputs[0]
244
245 return inputs
246
247 def load_embeddings(self, embeddings):
248 """处理Embedding层权重

Callers 15

apply_embeddingsMethod · 0.80
apply_main_layersMethod · 0.80
apply_final_layersMethod · 0.80
apply_main_layersMethod · 0.80
apply_embeddingsMethod · 0.80
apply_main_layersMethod · 0.80
apply_main_layersMethod · 0.80
apply_embeddingsMethod · 0.80
apply_main_layersMethod · 0.80
apply_final_layersMethod · 0.80
apply_embeddingsMethod · 0.80
apply_main_layersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected