Skip to content

Commit

Permalink
deprecation warning fixes (facebookresearch#2881)
Browse files Browse the repository at this point in the history
Summary:
## What does this PR do?

Fixes:

- 2x `DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working`

- 1x `/fairseq/optim/adam.py:98: DeprecationWarning: invalid escape sequence \:`

This is with py38.

Pull Request resolved: facebookresearch#2881

Reviewed By: alexeib

Differential Revision: D24959633

Pulled By: myleott

fbshipit-source-id: ac563e194d5f07e3817de55729b0448366a6dc23
  • Loading branch information
stas00 authored and facebook-github-bot committed Nov 14, 2020
1 parent b987d30 commit 0d03fbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fairseq/optim/adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import logging
import math
from collections import Collection
from collections.abc import Collection
from dataclasses import dataclass, field
from typing import List

Expand Down Expand Up @@ -95,7 +95,7 @@ def average_params(self):


class Adam(torch.optim.Optimizer):
"""Implements Adam algorithm.
r"""Implements Adam algorithm.
This implementation is modified from torch.optim.Adam based on:
`Fixed Weight Decay Regularization in Adam`
Expand Down
2 changes: 1 addition & 1 deletion fairseq/optim/nag.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

from collections import Collection
from collections.abc import Collection
from dataclasses import dataclass, field
from typing import List

Expand Down

0 comments on commit 0d03fbe

Please sign in to comment.