Skip to content

Commit

Permalink
Fix np.int usage warning, and flake8 warnings (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
VarIr authored Feb 9, 2021
1 parent faad18f commit b247cd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deepnog/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def collate_sequences(batch: Union[List[sequence_tuple], sequence_tuple],
max_len = sequence_len

# Collate the sequences
sequences = np.zeros((n_data, max_len,), dtype=np.int)
sequences = np.zeros((n_data, max_len,), dtype=np.int32)
for i, seq in enumerate(batch):
sequence = np.array(seq.encoded)
# If selected, choose randomly, where to insert zeros
Expand All @@ -123,7 +123,7 @@ def collate_sequences(batch: Union[List[sequence_tuple], sequence_tuple],

# Collate the labels
try:
labels = np.array([b.label for b in batch], dtype=np.int)
labels = np.array([b.label for b in batch], dtype=np.int32)
labels = default_collate(labels)
except (AttributeError, TypeError):
labels = None
Expand Down
2 changes: 0 additions & 2 deletions deepnog/learning/tests/test_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,3 @@ def test_shuffled_training(batch_size, num_workers):
assert x.shape == (2, 30)
np.testing.assert_equal(results.y_train_true.sum(), Y_TRUE.sum()) # order should be different
np.testing.assert_equal(results.y_val_pred.sum(), Y_TRUE.sum())


0 comments on commit b247cd7

Please sign in to comment.