Skip to content

Commit e147e52

Browse files
committed
Port to Pytorch 2.1
1 parent c26c5b4 commit e147e52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nnue_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def get_tensors(self, device):
5454
them = 1.0 - us
5555
outcome = torch.from_numpy(np.ctypeslib.as_array(self.outcome, shape=(self.size, 1))).pin_memory().to(device=device, non_blocking=True)
5656
score = torch.from_numpy(np.ctypeslib.as_array(self.score, shape=(self.size, 1))).pin_memory().to(device=device, non_blocking=True)
57-
white = torch._sparse_coo_tensor_unsafe(iw, white_values, (self.size, self.num_inputs))
58-
black = torch._sparse_coo_tensor_unsafe(ib, black_values, (self.size, self.num_inputs))
57+
white = torch.sparse_coo_tensor(iw, white_values, (self.size, self.num_inputs), check_invariants=False)
58+
black = torch.sparse_coo_tensor(ib, black_values, (self.size, self.num_inputs), check_invariants=False)
5959
white._coalesced_(True)
6060
black._coalesced_(True)
6161
return us, them, white, black, outcome, score

0 commit comments

Comments
 (0)