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

Method _sha256_tensor

lightx2v/disagg/services/encoder.py:602–609  ·  view source on GitHub ↗
(tensor: Optional[torch.Tensor])

Source from the content-addressed store, hash-verified

600 data_tensor = tensor.detach()
601 if data_tensor.dtype == torch.bfloat16:
602 data_tensor = data_tensor.to(torch.float32)
603 data = data_tensor.contiguous().cpu().numpy().tobytes()
604 return hashlib.sha256(data).hexdigest()
605
606 buffer_index = 0
607 context_buf = room_buffers[buffer_index]
608 context_buf.zero_()
609 context_view = _buffer_view(context_buf, GET_DTYPE(), tuple(context.shape))
610 context_view.copy_(context)
611 buffer_index += 1
612 if config.get("enable_cfg", False):

Callers

nothing calls this directly

Calls 2

cpuMethod · 0.80
toMethod · 0.45

Tested by

no test coverage detected