Fix crash when dealing with super large affinity matrices
Fix crash when dealing with super large affinity matrices: a task in lifesci-single-cell-spatial-swe-envs-nocap (Harbor dataset). Title: Fix crash when dealing with super large affinity matrices
The task
**Title:** Fix crash when dealing with super large affinity matrices
Part of scalingX/lifesci-single-cell-spatial-swe-envs-nocap.