I am using C++ torchlib, but I don’t know what to do it in c++ like that in pytorch:
min_real = torch.finfo(self.logits.dtype).min
# or
min_real = torch.finfo(self.logits.dtype).tiny
I am using C++ torchlib, but I don’t know what to do it in c++ like that in pytorch:
min_real = torch.finfo(self.logits.dtype).min
# or
min_real = torch.finfo(self.logits.dtype).tiny
I don’t think finfo
is exposed in libtorch
, but you should be able to use e.g.:
const auto int_min = std::numeric_limits<int>::min();
const auto int_max = std::numeric_limits<int>::max();