0
点赞
收藏
分享

微信扫一扫

利用torch处理分段函数中的奇点

一脸伟人痣 2022-02-27 阅读 67

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 条评论