pickle succeed perfectly in a Jupyter notebook but when I do it in a .py file pickle fails.
I don't understand why?
It's just a simple class
class X:
def __init__(self, ref):
import torch
self.ref = torch.tensor(ref)
self.result = torch.full(ref.shape, True, dtype=torch.uint8)
self.index = None
def partial_fit(self, X):
assert len(X) > 0
import numpy
blablabla
def transform(self, X):
return X[:, self.index]
Python version and package looks to be at same version