About logsumexp function in C++ libtorch

Hi ,All

I would like to convert the following line from
Pytorch to libtorch in C++.

X1=log_sum_exp(x)

I try to convert it in c++ as

Torch::X1=torch::log_sum_exp(x)

But it says incorrect.

Could anyone give suggestions about how to correct it please ?

Thanks.
Xu

Do you mean from torch.logsumexp?
https://pytorch.org/docs/stable/generated/torch.logsumexp.html
If so, we do have torch::logsumexp(tensor, {}, bool keepdim = false) where {} is a list of dimension you want to reduce.

1 Like