Merge pull request #6482 from ProGamerGov/patch-6
Add fallback for Protocol import
This commit is contained in:
commit
89c3663080
1 changed files with 7 additions and 1 deletions
|
@ -15,7 +15,13 @@ import torch
|
||||||
from torch import Tensor
|
from torch import Tensor
|
||||||
from torch.utils.checkpoint import checkpoint
|
from torch.utils.checkpoint import checkpoint
|
||||||
import math
|
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(
|
def narrow_trunc(
|
||||||
input: Tensor,
|
input: Tensor,
|
||||||
|
|
Loading…
Reference in a new issue