Skip to content

Using torch.cross without specifying the dim arg is deprecated, use torch.linalg.cross #6

@fnachon

Description

@fnachon

I found a warning with pytorch 2.3.1

/Users/florian/miniconda3/envs/rfdiffusion/lib/python3.10/site-packages/rfdiffusion/util.py:253: UserWarning: Using torch.cross without specifying the dim arg is deprecated.
Please either pass the dim explicitly or simply use torch.linalg.cross.
The default value of dim will change to agree with that of linalg.cross in a future release. (Triggered internally at /Users/runner/miniforge3/conda-bld/libtorch_1719361051023/work/aten/src/ATen/native/Cross.cpp:66.)
  Z = torch.cross(Xn, Yn)

I fixed it by replacing Z = torch.cross(Xn, Yn) by Z = torch.linalg.cross(Xn, Yn) in .../site-packages/rfdiffusion/util.py

Here is my full working conda environment:
rfdiffusion_mac_env.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions