ops: put meta-tensors in place to allow custom nodes to check geo

This commit is contained in:
Rattus 2026-03-14 09:15:57 +10:00
parent 3be6735ca2
commit 1120bccc23

View File

@ -578,7 +578,12 @@ class disable_weight_init:
self.norm_type = norm_type
self.scale_grad_by_freq = scale_grad_by_freq
self.sparse = sparse
self.weight = None
# Keep shape/dtype visible for module introspection without reserving storage.
embedding_dtype = dtype if dtype is not None else torch.get_default_dtype()
self.weight = torch.nn.Parameter(
torch.empty((num_embeddings, embedding_dim), device="meta", dtype=embedding_dtype),
requires_grad=False,
)
self.bias = None
self.weight_comfy_model_dtype = dtype