added stubs for jit tree views (#156504)

Fixes #156488

Pull Request resolved: https://github.com/pytorch/pytorch/pull/156504
Approved by: https://github.com/ezyang
This commit is contained in:
morrison-turnansky
2025-06-25 06:15:13 +00:00
committed by PyTorch MergeBot
parent c60327ba74
commit 9642c75689
3 changed files with 209 additions and 6 deletions

View File

@ -438,7 +438,11 @@ def build_def(ctx, py_def, type_line, def_name, self_name=None, pdt_arg_types=No
is_method = self_name is not None
if type_line is not None:
type_comment_decl = torch._C.parse_type_comment(type_line)
decl = torch._C.merge_type_from_type_comment(decl, type_comment_decl, is_method)
decl = torch._C.merge_type_from_type_comment(
decl, # type: ignore[arg-type]
type_comment_decl,
is_method, # type: ignore[assignment]
)
return Def(Ident(r, def_name), decl, build_stmts(ctx, body))
@ -1055,12 +1059,12 @@ class ExprBuilder(Builder):
in_expr = BinOp("in", lhs, rhs)
cmp_expr = UnaryOp(r, "not", in_expr)
else:
cmp_expr = BinOp(op_token, lhs, rhs)
cmp_expr = BinOp(op_token, lhs, rhs) # type: ignore[assignment]
if result is None:
result = cmp_expr
else:
result = BinOp("and", result, cmp_expr)
result = BinOp("and", result, cmp_expr) # type: ignore[assignment]
return result
@staticmethod