ayushkarnawat / profit

Exploring evolutionary protein fitness landscapes
MIT License
1 stars 0 forks source link

Rename pytorch to torch #107

Closed ayushkarnawat closed 4 years ago

ayushkarnawat commented 4 years ago

What does this PR do?

Renames all instances of "pytorch" to "torch".

ayushkarnawat commented 4 years ago

Generally, I think this is fine, however the user has to be careful. Instead of

# Example: two different modules point to the same variable name; can lead to errors 
import torch
from profit.models import torch

# This will not work
X = torch.Tensor([3.4, 8.6, 9.0])
# Traceback (most recent call last):
#   File "<stdin>", line 1, in <module>
# AttributeError: module 'profit.models.torch' has no attribute 'Tensor'

# This will work
model = torch.SequenceVAE(seqlen=56, vocab_size=20, hdim=50, latent_size=20)

the user should import local torch models as the following

import torch
from profit.models.torch import SequenceVAE

# This will now work
X = torch.Tensor([3.4, 8.6, 9.0])

# So will this
model = SequenceVAE(seqlen=56, vocab_size=20, hdim=50, latent_size=20)