Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too much time cost #21

Closed
nothingeasy opened this issue Sep 10, 2020 · 1 comment
Closed

Too much time cost #21

nothingeasy opened this issue Sep 10, 2020 · 1 comment

Comments

@nothingeasy
Copy link

It slower than before too many times when I use this sampler

(self.indices[i] for i in torch.multinomial(self.weights, self.num_samples, replacement=True))
it seems that this expression cost too much time!

Any one have any solution?

@www516717402
Copy link

www516717402 commented Sep 29, 2020

@nothingeasy
In my view, for function is surplus. Modify as follow:

return iter(torch.multinomial(self.weights, self.num_samples, replacement=True).tolist())

I test this modify currently(Not comfirm correct)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants