0

My below function call is returning tensor of infs.

def regression(my_x, my_m, my_b):
    return my_m*my_x + my_b

my_x is a Pytorch tensor. I think it is returning inf as it is crossing limit of float . how can I instruct multiplication operator to use bigger data type like float128 or Decimal?

Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
Pritesh
  • 1,938
  • 7
  • 32
  • 46
  • 1
    You probably have to cast your floats to `Decimal`. So you'd need a special function that does this to all the floats in your tensors. And pray that nothing breaks. – scr Nov 30 '22 at 03:36
  • Hopefully `my_x` does not contain `inf` values, which suggests that `my_m` and `my_b` are the culprits. Further assuming that the slope and intercept are fit during a learning process, it implies that an earlier optimization problem is not well-defined. Can you post more of your code or the data that led you to this problem? – Alexander L. Hayes Nov 30 '22 at 04:56

0 Answers0