IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Преглед на файлове

Protect against endless loop.

master
Stanislaw Adaszewski преди 4 години
родител
ревизия
2ff358f7ef
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. +5
    -0
      src/triacontagon/sampling.py

+ 5
- 0
src/triacontagon/sampling.py Целия файл

@@ -28,6 +28,11 @@ def fixed_unigram_candidate_sampler(
if len(num_repeats.shape) != 1:
raise ValueError('num_repeats must be 1D')
if torch.any(len(unigrams) - \
(true_classes >= 0).sum(dim=1) < \
num_repeats):
raise ValueError('Not enough classes to choose from')
num_rows = true_classes.shape[0]
print('true_classes.shape:', true_classes.shape)
# unigrams = np.array(unigrams)


Loading…
Отказ
Запис