mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Adding assert statements to unblock standard library. The same limitations that apply to the existing implementation of Exceptions apply to this as well (No control-flow logic, & we ignore the specific Exception thrown). Pull Request resolved: https://github.com/pytorch/pytorch/pull/13408 Reviewed By: driazati Differential Revision: D12876451 Pulled By: eellison fbshipit-source-id: 767ba5a50ba7c5dd6a857ed4845ac076a81cf305
77 lines
1.6 KiB
Plaintext
77 lines
1.6 KiB
Plaintext
(def
|
|
(ident fn)
|
|
(decl
|
|
(list
|
|
(param
|
|
(ident x)
|
|
(variable (ident Tensor)))
|
|
(param
|
|
(ident y)
|
|
(variable (ident Tensor)))
|
|
(param
|
|
(ident z)
|
|
(variable (ident Tensor))))
|
|
(option))
|
|
(list
|
|
(assign
|
|
(list (variable (ident q)))
|
|
(=)
|
|
(None))
|
|
(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)))))
|
|
(assert
|
|
(eq (const 1) (const 1))
|
|
(option (string_literal hello)))
|
|
(return
|
|
(list (variable (ident x))))))
|