Skip to content

Commit fb5de5e

Browse files
committed
Fix cuda error due to wrong tensor initialization with cuda
1 parent 4b49905 commit fb5de5e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ontolearn/learners/drill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ def learn_from_replay_memory(self) -> None:
525525
current_state_batch = torch.cat(current_state_batch, dim=0).to(self.device)
526526
# N, 1, dim
527527
next_state_batch = torch.cat(next_state_batch, dim=0).to(self.device)
528-
y = torch.Tensor(y, device=self.device)
528+
y = torch.Tensor(y).to(self.device)
529529

530530
try:
531531
assert current_state_batch.shape[1] == next_state_batch.shape[1] == self.emb_pos.shape[1] == \

ontolearn/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def read_csv(path)->Union[None,pd.DataFrame]: # pragma: no cover
156156
if assertion_path_isfile(path):
157157
df = pd.read_csv(path, index_col=0)
158158
assert (df.all()).all() # all columns and all rows are not none.
159-
df.index = df.index.map(lambda x: x.replace("<", "").replace(">", ""))
159+
df.index = df.index.map(lambda x: str(x).replace("<", "").replace(">", ""))
160160
return df
161161
else:
162162
return None

0 commit comments

Comments
 (0)