Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ctgan/synthesizers/tvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def __init__(
self.loss_values = pd.DataFrame(columns=['Epoch', 'Batch', 'Loss'])
self.verbose = verbose

self.decoder = None

if not cuda or not torch.cuda.is_available():
device = 'cpu'
elif isinstance(cuda, str):
Expand Down Expand Up @@ -243,4 +245,5 @@ def sample(self, samples):
def set_device(self, device):
"""Set the `device` to be used ('GPU' or 'CPU)."""
self._device = device
self.decoder.to(self._device)
if self.decoder:
self.decoder.to(self._device)