# batch_to_cpu **Repository Path**: mooyeh/batch_to_cpu ## Basic Information - **Project Name**: batch_to_cpu - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-03-12 - **Last Updated**: 2024-04-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 1. 下载仓库 ``` git clone https://gitee.com/mooyeh/batch_to_cpu.git ``` 2. 设置环境变量 ``` # 设置到my_to_cpu目录的上一级 export PYTHONPATH=:$PYTHONPATH ``` 3. 修改my_to_cpu/hook_module/support_wrap_ops.yaml文件 以需要将F.cross_entropy, Tensor.transpose, torch.diag to cpu为例,修改yaml文件如下所示(需要to cpu的列在对应类下面即可) ``` functional: - cross_entropy tensor: - transpose torch: - diag _VF: torch_npu: aten: distributed: ``` 4. 使能to cpu ``` from my_to_cpu.api_registry import enable_to_cpu ... enable_to_cpu() ```