salesforce / ULIP

BSD 3-Clause "New" or "Revised" License
436 stars 44 forks source link

Fix for deprecated torch string_classes import #26

Open juanmiguelnc opened 1 year ago

juanmiguelnc commented 1 year ago

This commit fixes a deprecated import statement in the codebase that uses the string_classes module from PyTorch. The deprecated import statement from torch import string_classes has been replaced with a simpler and more Pythonic alternative string_classes = str.

The string_classes module was previously used to define the type of a string, but it has been removed in more recent versions of PyTorch. This commit provides a cleaner and more compatible solution that works with newer versions of PyTorch.

See https://github.com/pytorch/pytorch/pull/94709

juanmiguelnc commented 1 year ago

This pull request fixes an issue with the previous import statement for string_classes. It has been updated to use str instead. This change should improve the overall readability and consistency of the code.