专栏算法工具链atan2 is not supported in hbir exporting

atan2 is not supported in hbir exporting

已解决
默认232322025-02-12
56
4

RuntimeError: Function on type <class 'torch.Tensor'> is not supported in hbir exporting

算法工具链
征程6
评论1
0/1000
  • 默认23232
    Lv.2

    File "/usr/local/lib/python3.10/dist-packages/hat/models/task_modules/centerpoint/decoder.py", line 163, in _decode_task rot = torch.atan2(rot_sine, rot_cosine) File "/usr/local/lib/python3.10/dist-packages/horizon_plugin_pytorch/quantization/hbdk4/export_hbir/export_hbir.py", line 958, in __torch_function__ raise e File "/usr/local/lib/python3.10/dist-packages/horizon_plugin_pytorch/quantization/hbdk4/export_hbir/export_hbir.py", line 914, in __torch_function__ raise RuntimeError(msg) RuntimeError: Function on type is not supported in hbir exporting

    2025-02-12
    0
    3
    • Huanghui回复默认23232:

      你好,这个原因是bpu中不支持torch.atan2算子转换,这个是双曲正切函数,需要两个输入,如 torch.atan2(y, x) 。。。。。在bpu中torch.atan可以转换成 horizon.nn.Atan ,但是torch.atan是单输入,所以你可以将 torch.atan2 替换成torch.atan,单输入的这个你可以 你可以根据反正切的数学公式来修改 。即 torch.atan(y / x) ,但是要注意象限 。其影响正负。

      2025-02-12
      1
    • Huanghui回复默认23232:

      纠正以下torch.atan2 不是双曲正切函数 ,是一个计算两个输入张量之间角度的函数

      2025-02-12
      0
    • 默认23232回复Huanghui:

      thanks, 已替换,解决。

      2025-02-12
      0