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-
利用torch处理分段函数中的奇点
阅读 68
2022-02-27
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-
相关推荐
精彩评论(0)