代码拉取完成,页面将自动刷新
同步操作将从 Ascend/pytorch 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
CDIR="$(cd "$(dirname "$0")" ; pwd -P)"
cd $CDIR
python_execute="$1"
pytorch_version="$2"
IFS='.' read -ra version_parts <<< "$pytorch_version"
pytorch_dir="v${version_parts[0]}r${version_parts[1]}"
file=$CDIR/third_party/op-plugin/gencode.sh
if [ -f "${file}" ]; then
bash ${file} ${pytorch_version} ${python_execute}
fi
op_plugin_config_path=$CDIR/third_party/op-plugin/op_plugin/config/$pytorch_dir
source_yaml="$CDIR/torch_npu/csrc/aten/npu_native_functions.yaml"
testing_source_yaml="$CDIR/test/ops_unsupport_list.yaml"
op_plugin_functions_yaml_path="$op_plugin_config_path/npu_native_functions.yaml"
${python_execute} -m codegen.gen_backend_stubs \
--output_dir="torch_npu/csrc/aten" \
--source_yaml="$source_yaml" \
--impl_path="$CDIR/torch_npu/csrc/aten" \
--op_plugin_impl_path="$CDIR/third_party/op-plugin/op_plugin/ops" \
--op_plugin_yaml_path="$op_plugin_config_path/op_plugin_functions.yaml"
${python_execute} -m codegen.autograd.gen_autograd \
--out_dir="$CDIR/torch_npu/csrc/aten" \
--autograd_dir="$CDIR/codegen/autograd" \
--npu_native_function_dir="$source_yaml"
${python_execute} -m codegen.codegen_ops_info
if [ -f $CDIR/third_party/op-plugin/codegen/templates/_op_plugin_docs.py ]; then
if [ -f $CDIR/torch_npu/_op_plugin_docs.py ]; then
# remove _op_plugin_docs.py
rm $CDIR/torch_npu/_op_plugin_docs.py
echo "Existing _op_plugin_docs.py in torch_npu deleted."
fi
cp -f $CDIR/third_party/op-plugin/codegen/templates/_op_plugin_docs.py $CDIR/torch_npu/_op_plugin_docs.py
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。