已合并
docs: add support status for torch.fx.experimental.symbolic_shapes APIs #36822
xuanzhi-2026创建于 5月26日
docs: add support status for torch.fx.experimental.symbolic_shapes APIs #36822
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 xuanzhi-2026 的贡献)5月26日 创建了 pull request,commit b783f852
5月26日 关联了issue:【开源实习】Torch-NPU API一致性对齐:补齐测试用例、API功能对齐、补齐文档(22)
ascend-robot
5月26日 评论:
5月26日 评论:
ascend-robot
5月26日 评论:
5月26日 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| docs | ✅ lyx324521, huangjingwei, chenrayray (3/2) | ✅ huangjingwei (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
xuanzhi-2026, thanks for your pull request. All authors of the commits have signed the CLA. 👍


5月26日 添加了label:ascend-cla/yes
此处折叠了120条消息 查看更多
7月8日 添加了label:lgtm
Jingwei Huang
7月8日 评论:
7月8日 评论:
/approve


7月8日 添加了label:approved
7月8日 合入了pull request
ascend-robot
7月8日 评论:
7月8日 评论:
流水线 pytorch_gitcode_PR_multiVersion#12191 [ commitID:e3ec8d46 ] 已完成


【合入来源】
【任务背景】
本 PR 对应 pytorch-vllm 开源实习项目中的 Torch-NPU API 一致性对齐任务,公开 issue:
https://gitcode.com/Ascend/pytorch/issues/1628
本 PR 是该 issue 的资料补齐 PR,用于在
docs/zh/native_apis的torch-fx.md支持矩阵中补充torch.fx.experimental.symbolic_shapes相关 API 的支持状态。同组交付 PR 如下:【API 功能介绍】
torch.fx.experimental.symbolic_shapes.ShapeEnv.size_hintallow_none控制无法求值时是否允许返回None。torch.fx.experimental.symbolic_shapes.ShapeEnv.suppress_guardsShapeEnv提供的上下文管理器,用于在局部代码块内临时抑制 guard 记录,避免辅助求值过程额外生成 guards。torch.fx.experimental.symbolic_shapes.ShapeEnvSettingsShapeEnv的配置数据结构,保存动态 shape 相关开关,例如 scalar output、dynamic output shape、duck shape、deferred runtime assert 等行为配置。torch.fx.experimental.symbolic_shapes.StatefulSymbolicContexttensor_source以及 ShapeEnv/source/symbol 的缓存,用于同一张量符号化过程中的符号复用。torch.fx.experimental.symbolic_shapes.StatelessSymbolicContextdynamic_sizes、dynamic_strides、constraint_sizes、constraint_strides等输入元信息,用于创建符号尺寸时描述动态维约束。【上游社区测试情况】
已基于当前分支基线检索
test目录中的相关覆盖情况:StatelessSymbolicContext在 dynamo export/subclass 场景中被使用,ShapeEnvSettings出现在 public API allowlist 中。ShapeEnv.size_hint、ShapeEnv.suppress_guards、ShapeEnvSettings字段构造、StatefulSymbolicContext/StatelessSymbolicContext默认状态的直接行为断言。【修改方案】
在
docs/zh/native_apis当前已有的 PyTorch 版本目录中,向torch-fx.md支持矩阵追加上述 5 个 API,支持状态标记为“是”,限制与说明为“-”,表示与原生 API 支持度保持一致。本 PR 覆盖以下资料文件:
【完备性分析】
docs/zh/native_apis下存在的 PyTorch 版本目录均已补充这 5 个 API 支持状态。【资料变更】
涉及资料变更。补充
torch.fx.experimental.symbolic_shapes相关 API 的支持状态说明。【接口变更】
不涉及。未修改跨仓接口或客户可见接口行为。
【功能验证】
本 PR 仅涉及资料更新,已确认提交只包含资料文件变更:
已基于最新
upstream/v2.7.1解决资料文件冲突并重新推送,当前提交为:本地校验:
PR 状态复查结果:
【测试效果 / 日志说明】
v2.7.1底座 cherry-pick 单个文档提交解决,当前 PR 分支保持 squash 后的单提交形态。【CheckList】