Files
pytorch/test/expect/TestScript.test_python_frontend.expect
James Reed 1533155c4e [JIT][script] Implement compile-time tuples & starred unpacking (#6214)
* Something that works

* Tuple sugared value

* Works with commenting out input size check

* support string frontend

* Initial starred assignment

* Fix parser

* Fixup tests

* clang-format

* fix rebase error

* lint

* move star assign test to string frontend to make py2 happy

* Py2 fix: parse starargs from Call node

* Address some comments

* Fixup merge

* Remove overloaded unary operators

* Bugfix and test case

* Address a few more comments

* asValues -> asTuple

* Remove unrolledFor stuff

* Fixup getValues

* Pass CallsiteDescriptor struct and have different behavior for different call types

* Address comments and lint

* some type checks

* Address comments

* lint

* Fix mistake
2018-04-09 19:34:51 -07:00

62 lines
1.3 KiB
Plaintext

(def
(ident fn)
(list
(param (ident x) (tensor_type))
(param (ident y) (tensor_type))
(param (ident z) (tensor_type)))
(list
(assign
(list (variable (ident q)))
(=)
(-
(+
(variable (ident x))
(variable (ident y)))
(apply
(.
(variable (ident z))
(ident sigmoid))
(list)
(list))))
(expression statement
(list
(apply
(variable (ident print))
(list (variable (ident q)))
(list))))
(assign
(list (variable (ident w)))
(=)
(unary minus
(variable (ident z))))
(if
(and
(and
(not (variable (ident x)))
(not (variable (ident y))))
(variable (ident z)))
(list
(assign
(list (variable (ident m)))
(=)
(if
(not (variable (ident z)))
(variable (ident x))
(variable (ident y)))))
(list))
(while
(and
(<
(variable (ident x))
(variable (ident y)))
(>
(variable (ident y))
(variable (ident z))))
(list
(assign
(list (variable (ident q)))
(=)
(variable (ident x)))))
(return
(list (variable (ident x))))))