Skip to content

Commit 57de5b5

Browse files
Lucaskabelafacebook-github-bot
authored andcommitted
Add typing annotations to guard and source
Summary: As part of better engineering week, we would like to improve out type support to improve dev experience in dynamo This PR adds strict typing support to a critical set of files for dynamo, `source.py` and the base `_guards.py` Running ``` mypy torch/_dynamo/source.py torch/_guards.py --linecount-report /tmp/coverage_log ``` | -------- | Lines Unannotated | Lines Total | % lines covered | Funcs Unannotated | Funcs Total | % funcs covered | | -------- | ------- | -------- | ------- | ------- | ------- | ------- | | Main | 1227 | 2208 | 55.57% | 207 | 362 | 57.18% | | This PR | 2217 | 2217 | 100.00% | 362 | 362 | 100.00% | | Delta | +990 | +9 | +44.43% | +155 | 0 | +42.82% | cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 jerryzh168 voznesenskym penguinwu EikanWang Guobing-Chen zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben X-link: pytorch/pytorch#158397 Reviewed By: yangw-dev Differential Revision: D79199389 Pulled By: Lucaskabela
1 parent 8b204c0 commit 57de5b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exir/passes/sym_shape_eval_pass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def call(self, graph_module: GraphModule):
225225
for i, v in enumerate(spec.shape):
226226
if concrete_shape[i] is None:
227227
# get updated shape from var_to_range
228-
_value_range = shape_env.var_to_range[
228+
_value_range = shape_env.var_to_range[ # pyre-fixme[16] `Optional` has no attribute `var_to_range`.
229229
v._sympy_() # pyre-fixme[16] Undefined attribute: `int` has no attribute `_sympy_`.
230230
]
231231
# cannot handle unbounded, unbacked symints; add a range to bound it.

0 commit comments

Comments
 (0)