DeMoriarty / fast_pytorch_kmeans

This is a pytorch implementation of k-means clustering algorithm
MIT License
279 stars 35 forks source link

Mode comparison warning in python (minor change) #6

Closed TheProjectsGuy closed 1 year ago

TheProjectsGuy commented 1 year ago

When you run the library after first install, it throws a SyntaxWarning

[/home2/avneesh.mishra/anaconda3/envs/vl-vpr/lib/python3.8/site-packages/fast_pytorch_kmeans/kmeans.py:224](https://vscode-remote+ssh-002dremote-002bgnode.vscode-resource.vscode-cdn.net/home2/avneesh.mishra/anaconda3/envs/vl-vpr/lib/python3.8/site-packages/fast_pytorch_kmeans/kmeans.py:224): SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.mode is "cosine":
[/home2/avneesh.mishra/anaconda3/envs/vl-vpr/lib/python3.8/site-packages/fast_pytorch_kmeans/kmeans.py:226](https://vscode-remote+ssh-002dremote-002bgnode.vscode-resource.vscode-cdn.net/home2/avneesh.mishra/anaconda3/envs/vl-vpr/lib/python3.8/site-packages/fast_pytorch_kmeans/kmeans.py:226): SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif self.mode is "euclidean":
[/home2/avneesh.mishra/anaconda3/envs/vl-vpr/lib/python3.8/site-packages/fast_pytorch_kmeans/multi_kmeans.py:209](https://vscode-remote+ssh-002dremote-002bgnode.vscode-resource.vscode-cdn.net/home2/avneesh.mishra/anaconda3/envs/vl-vpr/lib/python3.8/site-packages/fast_pytorch_kmeans/multi_kmeans.py:209): SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.mode is "cosine":
[/home2/avneesh.mishra/anaconda3/envs/vl-vpr/lib/python3.8/site-packages/fast_pytorch_kmeans/multi_kmeans.py:211](https://vscode-remote+ssh-002dremote-002bgnode.vscode-resource.vscode-cdn.net/home2/avneesh.mishra/anaconda3/envs/vl-vpr/lib/python3.8/site-packages/fast_pytorch_kmeans/multi_kmeans.py:211): SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif self.mode is "euclidean":

This is a minor change in string comparison (using == instead of is).