This issue is part of a Codex global repository scan.
Problem:
compute_overlap() records the original input device, creates overlap features via block_to_feature(), then calls .to(device) without assigning the returned tensors. Tensor.to() is not in-place.
Code reference:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/postprocess/ovp2c.py#L66-L69
Impact:
node_overlap and edge_overlap remain on CPU, causing device mismatches later for CUDA calculations using op2c-generated overlaps.
Suggested fix:
Assign the converted tensors back into the data dict, for example data[_keys.NODE_OVERLAP_KEY] = data[_keys.NODE_OVERLAP_KEY].to(device) and the same for edge overlap.
This issue is part of a Codex global repository scan.
Problem:
compute_overlap()records the original input device, creates overlap features viablock_to_feature(), then calls.to(device)without assigning the returned tensors.Tensor.to()is not in-place.Code reference:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/postprocess/ovp2c.py#L66-L69
Impact:
node_overlapandedge_overlapremain on CPU, causing device mismatches later for CUDA calculations using op2c-generated overlaps.Suggested fix:
Assign the converted tensors back into the data dict, for example
data[_keys.NODE_OVERLAP_KEY] = data[_keys.NODE_OVERLAP_KEY].to(device)and the same for edge overlap.