mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
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
76 lines
1.5 KiB
Plaintext
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)))))
|