提交 f714b302 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Use more user-friendly names and strings.

上级 0479c7b0
......@@ -391,7 +391,11 @@ class Constant(Value):
def __str__(self):
if self.name is not None:
return self.name
return str(self.data) #+ "::" + str(self.type)
else:
name = str(self.data)
if len(name) > 20:
name = name[:10] + '...' + name[-10]
return 'Constant{%s}' % name
def clone(self):
"""
We clone this object, but we don't clone the data to lower memory requirement
......
......@@ -423,4 +423,7 @@ class Generic(SingletonType):
Py_INCREF(py_%(name)s);
""" % locals()
def __str__(self):
return self.__class__.__name__
generic = Generic()
......@@ -933,11 +933,11 @@ def test_size():
def test_GetItem2D():
sparse_formats = ('csc', 'csr')
for format in sparse_formats:
x = theano.sparse.matrix(format)
a = theano.tensor.iscalar()
b = theano.tensor.iscalar()
c = theano.tensor.iscalar()
d = theano.tensor.iscalar()
x = theano.sparse.matrix(format, name='x')
a = theano.tensor.iscalar('a')
b = theano.tensor.iscalar('b')
c = theano.tensor.iscalar('c')
d = theano.tensor.iscalar('d')
# index
m = 1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论