pymiediff.helper.tg.patch_torchgdm_autodiff

pymiediff.helper.tg.patch_torchgdm_autodiff#

pymiediff.helper.tg.patch_torchgdm_autodiff()#

Patch torchgdm linear system to avoid inplace ops that break autograd.

Returns:

Audit report with the keys "_get_full_Gdotalpha", "_zero_fill_nonpolarizable_fields" and "solve", each mapping to the list of torchgdm class names that were actually patched. A target that could not be applied is reported via UserWarning rather than skipped silently, so a torchgdm rename fails visibly.

Return type:

dict