Files
pytorch/test/expect/TestScript.test_python_frontend.expect
Michael Suo 2a37740a86 make RHS of assignment optional
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23033

Test Plan: Imported from OSS

Differential Revision: D16383330

Pulled By: suo

fbshipit-source-id: 63c55fae06f0cd534eb5053f91a773431ad052d4
2019-07-23 12:21:19 -07:00

85 lines
1.7 KiB
Plaintext

(def
(ident fn)
(decl
(list
(param
(ident x)
(option)
(option)
(False))
(param
(ident y)
(option)
(option)
(False))
(param
(ident z)
(option)
(option)
(False)))
(option))
(list
(assign
(variable (ident q))
(option (None))
(option))
(assign
(variable (ident q))
(option
(-
(+
(variable (ident x))
(variable (ident y)))
(apply
(.
(variable (ident z))
(ident sigmoid))
(list)
(list))))
(option))
(expression statement
(apply
(variable (ident print))
(list (variable (ident q)))
(list)))
(assign
(variable (ident w))
(option
(unary minus
(variable (ident z))))
(option))
(if
(and
(and
(not (variable (ident x)))
(not (variable (ident y))))
(variable (ident z)))
(list
(assign
(variable (ident m))
(option
(if
(not
(variable (ident z)))
(variable (ident x))
(variable (ident y))))
(option)))
(list))
(while
(and
(<
(variable (ident x))
(variable (ident y)))
(>
(variable (ident y))
(variable (ident z))))
(list
(assign
(variable (ident q))
(option (variable (ident x)))
(option))))
(assert
(eq (const 1) (const 1))
(option (string_literal hello)))
(return (variable (ident x)))))