Fix exception thrown using MishActivation (#19739)

* Fix exception thrown using MishActivation

* Update activations.py
This commit is contained in:
Chino 2022-10-20 21:13:35 +08:00 committed by GitHub
parent 2dd1b8f0c5
commit baa00f65ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,7 +121,7 @@ class MishActivation(nn.Module):
def __init__(self):
super().__init__()
if version.parse(version.parse(torch.__version__).base_version) < version.parse("1.9"):
if version.parse(torch.__version__) < version.parse("1.9.0"):
self.act = self._mish_python
else:
self.act = nn.functional.mish