pytorch compile aten only
时间: 2023-09-26 22:09:49 浏览: 116
To compile only the ATen (PyTorch's tensor library) component of PyTorch, you can follow these steps:
1. Clone the PyTorch repository from GitHub:
```bash
git clone https://github.com/pytorch/pytorch.git
```
2. Change into the PyTorch directory:
```bash
cd pytorch
```
3. Build PyTorch with only ATen using the following commands:
```bash
python setup.py build --cmake-only
```
This command will generate the necessary CMake files for building PyTorch, including ATen.
4. Create a build directory and change into it:
```bash
mkdir build
cd build
```
5. Run CMake to configure the build:
```bash
cmake ..
```
6. Build ATen:
```bash
make aten
```
This command will compile only the ATen library. You can also specify additional targets to build if needed.
After the build process completes successfully, you will have the compiled ATen library available for use in your project.
Please note that compiling only ATen may not be sufficient to use PyTorch fully. Depending on your requirements, you may need to compile other components as well.
阅读全文