Skip to content

Commit

Permalink
__init__.py: added 'show_tree' example to ch.demo()
Browse files Browse the repository at this point in the history
  • Loading branch information
mattloper committed Aug 24, 2014
1 parent 016dfc6 commit d9a6c60
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ def test():
print result.dr_wrt(x1) # prints 1
"""

demos['show_tree'] = """
import chumpy as ch
[x1, x2, x3] = ch.array(10), ch.array(20), ch.array(30)
for i in range(3): x2 = x1 + x2 + x3
x2.dr_wrt(x1) # pull cache
x2.dr_wrt(x3) # pull cache
x1.label='x1' # for clarity in show_tree()
x2.label='x2' # for clarity in show_tree()
x3.label='x3' # for clarity in show_tree()
x2.show_tree(cachelim=1e-4) # in MB
"""

demos['matrix'] = """
import chumpy as ch
Expand Down

0 comments on commit d9a6c60

Please sign in to comment.