MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / _map

Function _map

diffusers/examples/textual_inversion/textual_inversion_flax.py:476–485  ·  view source on GitHub ↗
(params, mask, label_fn)

Source from the content-addressed store, hash-verified

474
475 def create_mask(params, label_fn):
476 def _map(params, mask, label_fn):
477 for k in params:
478 if label_fn(k):
479 mask[k] = "token_embedding"
480 else:
481 if isinstance(params[k], dict):
482 mask[k] = {}
483 _map(params[k], mask[k], label_fn)
484 else:
485 mask[k] = "zero"
486
487 mask = {}
488 _map(params, mask, label_fn)

Callers 1

create_maskFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected