Add fallback for Protocol import

This commit is contained in:
ProGamerGov 2023-01-07 13:08:21 -07:00 committed by GitHub
parent 151233399c
commit 984b86dd0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -15,7 +15,13 @@ import torch
from torch import Tensor
from torch.utils.checkpoint import checkpoint
import math
from typing import Optional, NamedTuple, Protocol, List
try:
from typing import Protocol
except:
from typing_extensions import Protocol
from typing import Optional, NamedTuple, List
def narrow_trunc(
input: Tensor,