提交 a6e974f7 authored 作者: projects@lgcm's avatar projects@lgcm

gen oplist no longer runs on import

上级 ba5d6da9
......@@ -45,52 +45,56 @@ def chomp(s):
return "".join(r)
import scalar, sparse, tensor
def generate():
"""Generate the op list"""
import scalar, sparse, tensor
print_title("Theano Op List", "~")
print ""
print ".. contents:: "
print ""
print_title("Theano Op List", "~")
print ""
print ".. contents:: "
print ""
for module in [scalar, sparse, tensor]:
print_title('module: `%s`' % module.__name__, '=')
for module in [scalar, sparse, tensor]:
print_title('module: `%s`' % module.__name__, '=')
print_title('Op Classes', '-')
print_title('Op Classes', '-')
for symbol_name in dir(module):
for symbol_name in dir(module):
symbol = getattr(module, symbol_name)
symbol = getattr(module, symbol_name)
if isOpClass(symbol):
print ""
print "- :api:`%s.%s`" % (symbol.__module__, symbol_name)
docstring = getattr(symbol, '__doc__', "")
if isOpClass(symbol):
print ""
print "- :api:`%s.%s`" % (symbol.__module__, symbol_name)
docstring = getattr(symbol, '__doc__', "")
if not docstring:
print " ", '(no doc)'
elif len(docstring) < 50:
print " ", chomp(docstring)
else:
print " ", chomp(docstring[:40]), "..."
# a little trailing whitespace
print ""
if not docstring:
print " ", '(no doc)'
elif len(docstring) < 50:
print " ", chomp(docstring)
else:
print " ", chomp(docstring[:40]), "..."
# a little trailing whitespace
print ""
print_title('Op Constructors', '-')
for symbol_name in dir(module):
print_title('Op Constructors', '-')
for symbol_name in dir(module):
symbol = getattr(module, symbol_name)
symbol = getattr(module, symbol_name)
if isOpConstructor(symbol, module):
print ""
print "- :api:`%s.%s`" % (symbol.__module__, symbol_name)
docstring = getattr(symbol, '__doc__', "")
if isOpConstructor(symbol, module):
print ""
print "- :api:`%s.%s`" % (symbol.__module__, symbol_name)
docstring = getattr(symbol, '__doc__', "")
if not docstring:
print " ", 'No documentation'
elif len(docstring) < 50:
print " ", chomp(docstring)
else:
print " ", chomp(docstring[:40]), "..."
# a little trailing whitespace
print ""
if not docstring:
print " ", 'No documentation'
elif len(docstring) < 50:
print " ", chomp(docstring)
else:
print " ", chomp(docstring[:40]), "..."
# a little trailing whitespace
print ""
if __name__ == "__main__":
generate()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论