torch.atan2¶
- torch.atan2(input: 張量, other: 張量, *, out: Optional[張量]) 張量¶
逐元素的反正切,計算 並考慮象限。返回一個新張量,其中包含向量 與向量 之間的帶符號角度(以弧度為單位)。(請注意,第二個引數 是 x 座標,而第一個引數 是 y 座標。)
input和other的形狀必須是可廣播的。示例
>>> a = torch.randn(4) >>> a tensor([ 0.9041, 0.0196, -0.3108, -2.4423]) >>> torch.atan2(a, torch.randn(4)) tensor([ 0.9833, 0.0811, -1.9743, -1.4151])