Closed Athospd closed 5 years ago
This seems like a bug in pytorch itself - or in the docs. See for example:
>>> import torch
>>> x = torch.randn(2,2,2)
>>> torch.logsumexp(x, 0)
tensor([[1.4389, 0.9872],
[0.9308, 1.1934]])
>>> torch.logsumexp(x, (0,1))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: logsumexp(): argument 'dim' (position 2) must be int, not tuple
I think we should mimic pytorch's behavior for now and file an issue in pytorch.
About
tch_logsumexp()
Doc says it accepts dim (int or tuple of python:ints) – the dimension or dimensions to reduce Source say it accepts int64_t dim
When I tried to pass
Rcpp::Nullable<Rcpp::IntegerVector> dim
tologsumexp
it thrown an error. And when I passedstd::int64_t dim
it finally worked out.Am I missing something?