feat(compatibility): Python3.7 compatibility

This commit is contained in:
Alexander Engelsberger 2021-08-30 17:00:46 +02:00 committed by Alexander Engelsberger
parent 7f0a8e9bce
commit 083b5c1597
3 changed files with 2 additions and 4 deletions

View File

@ -4,6 +4,7 @@ language: python
python: python:
- 3.9 - 3.9
- 3.8 - 3.8
- 3.7
cache: cache:
directories: directories:
- "$HOME/.cache/pip" - "$HOME/.cache/pip"

View File

@ -41,9 +41,6 @@ def euclidean_distance_v2(x, y):
# batch diagonal. See: # batch diagonal. See:
# https://pytorch.org/docs/stable/generated/torch.diagonal.html # https://pytorch.org/docs/stable/generated/torch.diagonal.html
distances = torch.diagonal(pairwise_distances, dim1=-2, dim2=-1) distances = torch.diagonal(pairwise_distances, dim1=-2, dim2=-1)
# print(f"{diff.shape=}") # (nx, ny, ndim)
# print(f"{pairwise_distances.shape=}") # (nx, ny, ny)
# print(f"{distances.shape=}") # (nx, ny)
return distances return distances

View File

@ -59,7 +59,7 @@ setup(
url=PROJECT_URL, url=PROJECT_URL,
download_url=DOWNLOAD_URL, download_url=DOWNLOAD_URL,
license="MIT", license="MIT",
python_requires=">=3.8", python_requires=">=3.7",
install_requires=INSTALL_REQUIRES, install_requires=INSTALL_REQUIRES,
extras_require={ extras_require={
"datasets": DATASETS, "datasets": DATASETS,