code: def __init__(self, arch: MODEL_ARCH, n_blocks: int):
      self.mapping = {}
      for tensor, keys in self.mappings_cfg.items():
          if tensor not in MODEL_TENSORS[arch]:
              continue
          tensor_name = TENSOR_NAMES[tensor]
          self.mapping[tensor_name] = (tensor, tensor_name)
          for key in keys:
              self.mapping[key] = (tensor, tensor_name)
      for bid in range(n_blocks):
          for tensor, keys in self.block_mappings_cfg.items():
              if tensor not in MODEL_TENSORS[arch]:
                  continue
              # TODO: make this configurable
              n_experts = 8
              for xid in range(n_experts):
                  tensor_name = TENSOR_NAMES[tensor].format(
                      bid=bid, xid=xid
                  )
                  self.mapping[tensor_name] = (tensor, tensor_name)
                  for key in keys:
                      key = key.format(bid=bid, xid=xid)
                      self.mapping[key] = (tensor, tensor_name)
  
file_path: llama.cpp/gguf-py/gguf/tensor_mapping.py
imports: from __future__ import annotations
  from typing import Sequence
  from .constants import MODEL_ARCH, MODEL_TENSOR, MODEL_TENSORS, TENSOR_NAMES
label_desc: Use image node_id 1 to create a new TensorNameMap object  with example: obj = TensorNameMap(arch, n_blocks)