pytorch/test/expect/TestScript.test_python_frontend.expect
Zachary DeVito 4c6da649e5 Partial support for kwarg_only arguments in script (#17339)
Summary:
This provides the minimum necessary to allow derivative formulas for things that have a kwarg only specifier in their schema. Support for non-parser frontend default arguments for kwargs is not completed.
Fixes #16921
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17339

Differential Revision: D14160923

Pulled By: zdevito

fbshipit-source-id: 822e964c5a3fe2806509cf24d9f51c6dc01711c3
2019-02-21 15:27:06 -08:00

76 lines
1.5 KiB
Plaintext

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