Skip to content

nagisa-eevee/deal-with-nan-grad-when-masking-in-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

deal-with-nan-grad-when-masking-in-pytorch

I got nan grad when backward a piecewise function in pytorch, and the function uses a mask(something like mask = x > threshold) to split input x into several intervals.

I found two ways to deal with it, both using hook or build-in functions instead of masking. Both of them have some drawbacks, and I want to find a simple & universal way to deal with it.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages