Skip to content

Commit d8c3e79

Browse files
committed
fix: correct typos 'occured' and 'occurence'
Issue facebookresearch#5646: Fix typos in comments - huffman_coder.py: 'occurence count' -> 'occurrence count' - dynamic_loss_scaler.py: 'has occured' -> 'has occurred' This PR has been tested locally.
1 parent 3d262bb commit d8c3e79

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎fairseq/data/huffman/huffman_coder.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def decode(self, bits: bitarray) -> tp.Iterator["HuffmanNode"]:
173173

174174
class HuffmanCodeBuilder:
175175
"""
176-
build a dictionary with occurence count and then build the Huffman code for it.
176+
build a dictionary with occurrence count and then build the Huffman code for it.
177177
"""
178178

179179
def __init__(self):

‎fairseq/optim/dynamic_loss_scaler.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _decrease_loss_scale(self):
4242
def check_overflow(self, grad_norm):
4343
# detect inf and nan
4444
if grad_norm == float("inf") or grad_norm != grad_norm:
45-
# overflow has occured
45+
# overflow has occurred
4646
prev_scale = self.loss_scale
4747
iter_since_rescale = self._iter - self._last_rescale_iter
4848

0 commit comments

Comments
 (0)