MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / empty_aligned

Method empty_aligned

lightx2v/utils/ggml_tensor.py:93–96  ·  view source on GitHub ↗
(
        cls, shape: Tuple[int, ...], orig_shape: Tuple[int, ...] = None, dtype: torch.dtype = torch.float32, gguf_type: gguf.GGMLQuantizationType = None, pin_memory: bool = False
    )

Source from the content-addressed store, hash-verified

91
92 @classmethod
93 def empty_aligned(
94 cls, shape: Tuple[int, ...], orig_shape: Tuple[int, ...] = None, dtype: torch.dtype = torch.float32, gguf_type: gguf.GGMLQuantizationType = None, pin_memory: bool = False
95 ) -> "GGMLTensor":
96 return cls(dtype=dtype, orig_shape=orig_shape, gguf_type=gguf_type, pin_memory=pin_memory, aligned=True, preallocated=True)
97
98 def copy_from(self, source: Union[torch.Tensor, "GGMLTensor"], transpose: bool = False, non_blocking: bool = False) -> "GGMLTensor":
99 if not self._preallocated:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected