mirror of
https://github.com/zebrajr/pytorch.git
synced 2026-01-15 12:15:51 +00:00
* 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
62 lines
1.3 KiB
Plaintext
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))))))
|