def METHOD_NAME(layer, nth, level):
    name = type(layer).__name__
    print("  " * level, nth, name)
    if name == "BertLayer":
        pd = dict(layer.named_parameters())
        for n in pd:
            print("  " * (level + 1), n, pd[n].shape)
        convert(pd, ["attention.self.query.weight"], f"encoder_l{nth + 1}_self_Wq", transpose=True)
        convert(pd, ["attention.self.key.weight"],   f"encoder_l{nth + 1}_self_Wk")
        convert(pd, ["attention.self.value.weight"], f"encoder_l{nth + 1}_self_Wv")
        convert(pd, ["attention.self.query.bias"],   f"encoder_l{nth + 1}_self_bq", bias=True)
        convert(pd, ["attention.self.key.bias"],     f"encoder_l{nth + 1}_self_bk", bias=True)
        convert(pd, ["attention.self.value.bias"],   f"encoder_l{nth + 1}_self_bv", bias=True)
        convert(pd, ["attention.output.dense.weight"], f"encoder_l{nth + 1}_self_Wo")
        convert(pd, ["attention.output.dense.bias"],   f"encoder_l{nth + 1}_self_bo", bias=True)
        convert(pd, ["attention.output.LayerNorm.weight"], f"encoder_l{nth + 1}_self_Wo_ln_scale", bias=True)
        convert(pd, ["attention.output.LayerNorm.bias"],   f"encoder_l{nth + 1}_self_Wo_ln_bias", bias=True)
        convert(pd, ["intermediate.dense.weight"], f"encoder_l{nth + 1}_ffn_W1")
        convert(pd, ["intermediate.dense.bias"],   f"encoder_l{nth + 1}_ffn_b1", bias=True)
        convert(pd, ["output.dense.weight"], f"encoder_l{nth + 1}_ffn_W2")
        convert(pd, ["output.dense.bias"],   f"encoder_l{nth + 1}_ffn_b2", bias=True)
        convert(pd, ["output.LayerNorm.weight"], f"encoder_l{nth + 1}_ffn_ffn_ln_scale", bias=True)
        convert(pd, ["output.LayerNorm.bias"],   f"encoder_l{nth + 1}_ffn_ffn_ln_bias", bias=True)
        config["enc-depth"] += 1
    elif name == "BertEmbeddings":
        for n, p in layer.named_parameters():
            print("  " * (level + 1), n, p.shape)
        pd = dict(layer.named_parameters())
        convert(pd, ["word_embeddings.weight"], f"Wemb", transpose=False)
        convert(pd, ["position_embeddings.weight"], f"Wpos", transpose=False)
        config["bert-type-vocab-size"] = 0
        if hasattr(layer, "token_type_embeddings"):
            convert(pd, ["token_type_embeddings.weight"], f"Wtype", transpose=False)
            config["bert-type-vocab-size"] = pd["token_type_embeddings.weight"].shape[0]
            config["bert-train-type-embeddings"] = True
        convert(pd, ["LayerNorm.weight"], f"encoder_emb_ln_scale_pre", bias=True)
        convert(pd, ["LayerNorm.bias"],   f"encoder_emb_ln_bias_pre", bias=True)
        config["dim-emb"]    = pd["word_embeddings.weight"].shape[1]
        config["dim-vocabs"] = [ pd["word_embeddings.weight"].shape[0] ]
        config["max-length"] = pd["position_embeddings.weight"].shape[0]
    elif name == "BertPooler":
        for n, p in layer.named_parameters():
            print("  " * (level + 1), n, p.shape)
        pd = dict(layer.named_parameters())
        convert(pd, ["dense.weight"], "classifier_ff_logit_l1_W")
        convert(pd, ["dense.bias"], "classifier_ff_logit_l1_b", bias=True)
    else:
        recurse(layer, level + 1)