提交 cdc17115 authored 作者: James Bergstra's avatar James Bergstra

added typelist, comments to oplist

上级 d5e4d890
...@@ -3,11 +3,20 @@ __docformat__ = "restructuredtext en" ...@@ -3,11 +3,20 @@ __docformat__ = "restructuredtext en"
import sys import sys
import gof import gof
def print_title(title_string, under_char): def print_title(title_string, under_char, over_char=''):
l = len(title_string)
if over_char:
print over_char * l
print title_string print title_string
print under_char * len(title_string)
if under_char:
print under_char * l
print "" print ""
def print_hline():
print '-' * 80
class Entry: class Entry:
"""Structure for generating the oplist file""" """Structure for generating the oplist file"""
...@@ -105,11 +114,6 @@ def search_entries(module_list): ...@@ -105,11 +114,6 @@ def search_entries(module_list):
return ops, constructors return ops, constructors
def print_entries(ops, constructors): def print_entries(ops, constructors):
print_title("Theano Op List", "~")
print ""
print ".. contents:: "
print ""
tags = {} tags = {}
for o in ops + constructors: for o in ops + constructors:
for t in o.tags: for t in o.tags:
...@@ -139,5 +143,19 @@ if __name__ == "__main__": ...@@ -139,5 +143,19 @@ if __name__ == "__main__":
"""Generate the op list""" """Generate the op list"""
import scalar, sparse, tensor import scalar, sparse, tensor
print_title("Op List", "~", "~")
print """
This page lists the `Op Classes` and `constructors` that are provided by the Theano library.
`Op Classes` drive from :api:`Op`, whereas `constructors` are typically `Op Class` instances, but may be true Python functions.
In the future, this list may distinguish `constructors` that are Op instances from true Python functions.
"""
print_hline()
print ""
print ".. contents:: "
print ""
ops, constructors = search_entries([scalar, sparse, tensor]) ops, constructors = search_entries([scalar, sparse, tensor])
print_entries(ops, constructors) print_entries(ops, constructors)
from gen_oplist import print_title, print_hline
if __name__ == '__main__':
print_title("Type List", "~", "~")
print "*THIS PAGE IS A PLACEHOLDER: WRITEME *"
print ""
print_hline()
print ""
print ".. contents::"
print ""
print_title("Type Classes", '=')
print "- scalar.Scalar\n"
print "- tensor.Tensor\n"
print "- sparse.Sparse\n"
print_title("Type Instances", '=')
print "- scalar.int8\n"
print "- tensor.lvector\n"
print "- sparse.??\n"
...@@ -24,20 +24,21 @@ if [ " $1" != " epydoc" ]; then ...@@ -24,20 +24,21 @@ if [ " $1" != " epydoc" ]; then
#generate the index & readme files #generate the index & readme files
echo "$APIRST2HTML $EPYDOC_ARGS index.txt html/index.html..." echo "$APIRST2HTML $EPYDOC_ARGS index.txt html/index.html..."
$APIRST2HTML $EPYDOC_ARGS --stylesheet=style.css index.txt html/index.html $APIRST2HTML -stg $EPYDOC_ARGS --stylesheet=style.css index.txt html/index.html
echo "$APIRST2HTML $EPYDOC_ARGS README.txt html/README.html..." echo "$APIRST2HTML $EPYDOC_ARGS README.txt html/README.html..."
$APIRST2HTML $EPYDOC_ARGS --stylesheet=style.css README.txt html/README.html $APIRST2HTML -stg $EPYDOC_ARGS --stylesheet=style.css README.txt html/README.html
#generate the oplist in ReST format #generate the oplist in ReST format
echo "gen oplist..." echo "gen oplist..."
python gen_oplist.py > doc/oplist.txt python gen_oplist.py > doc/oplist.txt
python gen_typelist.py > doc/typelist.txt
#generate html files for all the ReST documents in doc/ #generate html files for all the ReST documents in doc/
echo "gen doc/*.txt..." echo "gen doc/*.txt..."
for RST in doc/*.txt; do for RST in doc/*.txt; do
BASENAME=$(basename $RST .txt) BASENAME=$(basename $RST .txt)
echo "gen doc/$BASENAME.txt..." echo "gen doc/$BASENAME.txt..."
$APIRST2HTML $EPYDOC_ARGS --stylesheet=../style.css doc/$BASENAME.txt html/doc/$BASENAME.html $APIRST2HTML -stg $EPYDOC_ARGS --stylesheet=../style.css doc/$BASENAME.txt html/doc/$BASENAME.html
done done
fi fi
...@@ -1397,7 +1397,7 @@ class Split(Op): ...@@ -1397,7 +1397,7 @@ class Split(Op):
raise ValueError('In Split.perform(), len(splits) != len_splits.', raise ValueError('In Split.perform(), len(splits) != len_splits.',
(len(splits), self.len_splits)) (len(splits), self.len_splits))
# Checking is done, lets roll the splitting algorithm! # Checking is done, let's roll the splitting algorithm!
# Basically we step along the given axis of x, extracting subtensors of size splits[i] # Basically we step along the given axis of x, extracting subtensors of size splits[i]
# as we go along. # as we go along.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论