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

Method load

lightx2v/common/ops/tensor/tensor.py:25–31  ·  view source on GitHub ↗
(self, weight_dict)

Source from the content-addressed store, hash-verified

23 self.create_cuda_buffer = create_cuda_buffer
24 self.create_cpu_buffer = create_cpu_buffer
25 self.infer_dtype = GET_DTYPE()
26 self.sensitive_layer_dtype = GET_SENSITIVE_DTYPE()
27
28 def describe_storage(self, metadata):
29 source = metadata[self.tensor_name]
30 return StorageDescription((WeightStorage(self.tensor_name, "tensor", source.shape, source.loaded_dtype or source.dtype),))
31
32 def load(self, weight_dict):
33 if isinstance(weight_dict, BlockLoadContext):
34 attr = "tensor_cuda_buffer" if self.create_cuda_buffer else "pin_tensor"

Callers

nothing calls this directly

Calls 3

_load_cuda_bufferMethod · 0.95
_load_cpu_pin_bufferMethod · 0.95
_load_default_tensorsMethod · 0.95

Tested by

no test coverage detected