MCPcopy Index your code
hub / github.com/huggingface/diffusers / get_attn2_layers

Function get_attn2_layers

scripts/convert_sd3_to_diffusers.py:247–254  ·  view source on GitHub ↗
(state_dict)

Source from the content-addressed store, hash-verified

245
246
247def get_attn2_layers(state_dict):
248 attn2_layers = []
249 for key in state_dict.keys():
250 if "attn2." in key:
251 # Extract the layer number from the key
252 layer_num = int(key.split(".")[1])
253 attn2_layers.append(layer_num)
254 return tuple(sorted(set(attn2_layers)))
255
256
257def get_pos_embed_max_size(state_dict):

Callers 1

mainFunction · 0.70

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…