Skip to content

Fix NaN values in IntLayerNorm#30

Open
AmosHason wants to merge 1 commit into
kssteven418:ibertfrom
AmosHason:fix_nan_values
Open

Fix NaN values in IntLayerNorm#30
AmosHason wants to merge 1 commit into
kssteven418:ibertfrom
AmosHason:fix_nan_values

Conversation

@AmosHason

Copy link
Copy Markdown

Add an epsilon to std_int in the forward pass of IntLayerNorm to prevent NaN values due to multiplication of 0 by infinity.
The same result can alternatively be achieved by calling torch.nan_to_num(y_int).

Add an epsilon to `std_int` in the forward pass of `IntLayerNorm` to prevent `NaN` values due to multiplication of 0 by infinity.
The same result can alternatively be achieved by calling `torch.nan_to_num(y_int)`.
@AmosHason

Copy link
Copy Markdown
Author

Fixes #31.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant