torch.save(model, 'model.pth')

model = torch.load('model.pth')

The docs say

This approach uses Python pickle module when serializing the model, thus it relies on the actual class definition to be available when loading the model.

What exactly does available mean? Where should it be available? In which directory or path do I need to have it stored?
I’ve provided a little more detail here.
  
    
    
    Error when I use torch.save() and torch.load() 
  
  
    The code and weights are pretty standard. Just a regular network on jupyter notebook 
I wrote this model that converts an image into a vector, on colab 
class ConvEncoder(nn.Module):
    def __init__(self):
        super().__init__()

        self.conv1 = nn.Conv2d(3, 16, (3, 3), padding=(1, 1))
        self.bn1 = nn.BatchNorm2d(16)
        self.relu1 = nn.ReLU()
        self.maxpool1 = nn.MaxPool2d((2, 2))

        self.conv2 = nn.Conv2d(16, 32, (3, 3), padding=(1, 1))
        self.bn2 = nn.Bat…