Commit ff9d5d38 authored by Yanghan Wang's avatar Yanghan Wang Committed by Facebook GitHub Bot
Browse files

fallback to import from typing_extensions for older python version

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/98

https://github.com/facebookresearch/d2go/issues/60#issuecomment-863149605
#stamp2ship

Reviewed By: zhanghang1989

Differential Revision: D29495802

fbshipit-source-id: 0dc63b1ee1f7c8c0a694c39ce41ab77c25109c60
parent 2ff49517
...@@ -27,9 +27,18 @@ NOTE: ...@@ -27,9 +27,18 @@ NOTE:
import json import json
import logging import logging
import os import os
import sys
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import Callable, Dict, NamedTuple, Optional, Union from typing import Callable, Dict, NamedTuple, Optional, Union
from typing import final
if sys.version_info >= (3, 8):
from typing import final
else:
# If final decorator not available when using older python version, replace with the
# dummy implementation that does nothing.
def final(func):
return func
import torch import torch
import torch.nn as nn import torch.nn as nn
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment