I want to implement a piecewise function on a tensor that has the following logic for each element in the tensor.
def f(x):
if x==0.5:
return 1
else:
return torch.atanh(x)/(x-
微信扫一扫
I want to implement a piecewise function on a tensor that has the following logic for each element in the tensor.
def f(x):
if x==0.5:
return 1
else:
return torch.atanh(x)/(x-
相关推荐