This issue is part of a Codex global repository scan.
Problem:
TBSystem._save_h5() writes tensor blocks with block.detach().numpy(). Pardiso export gets HR/SR from the calculator on the model device, so CUDA-backed models can pass CUDA tensors into this writer.
Code reference:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/postprocess/unified/system.py#L902-L907
Impact:
to_pardiso() and to_pardiso_json() can fail during HDF5 export when the model/calculator runs on CUDA.
Suggested fix:
Use block.detach().cpu().numpy() for tensor blocks before creating HDF5 datasets.
This issue is part of a Codex global repository scan.
Problem:
TBSystem._save_h5()writes tensor blocks withblock.detach().numpy(). Pardiso export gets HR/SR from the calculator on the model device, so CUDA-backed models can pass CUDA tensors into this writer.Code reference:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/postprocess/unified/system.py#L902-L907
Impact:
to_pardiso()andto_pardiso_json()can fail during HDF5 export when the model/calculator runs on CUDA.Suggested fix:
Use
block.detach().cpu().numpy()for tensor blocks before creating HDF5 datasets.