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 3 年之前
父節點
當前提交
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…
取消
儲存