提交 b39f256c authored 作者: Frederic's avatar Frederic

typo/comment following code review.

上级 e132aedb
...@@ -391,7 +391,7 @@ AddConfigVar('compute_test_value', ...@@ -391,7 +391,7 @@ AddConfigVar('compute_test_value',
AddConfigVar('compute_test_value_opt', AddConfigVar('compute_test_value_opt',
("For debugging Theano optimization only." ("For debugging Theano optimization only."
" Same as compute_test_value, but is used" " Same as compute_test_value, but is used"
" durint Theano optimizatoin"), " during Theano optimization"),
EnumStr('off', 'ignore', 'warn', 'raise', 'pdb'), EnumStr('off', 'ignore', 'warn', 'raise', 'pdb'),
in_c_key=False) in_c_key=False)
......
...@@ -183,40 +183,23 @@ class Scalar(Type): ...@@ -183,40 +183,23 @@ class Scalar(Type):
def dtype_specs(self): def dtype_specs(self):
try: try:
# To help debug dtype/typenum problem, here is the list of numpy typenum. # To help debug dtype/typenum problem, here is code to get
# the list of numpy typenum. This list change between 32
# and 64 bit platform and probably also also between
# Windows and Linux.
# NOTE: equivalent type on a platform can have different typenum.
# This is the source of all dtype/typenum problem found up to
# now, as Theano always expect the exact typenum that
# correspond to our supported dtype.
""" """
for dtype in ['int8','uint8','short','ushort','intc','uintc', 'longlong','ulonglong','single','double','longdouble', 'csingle','cdouble','clongdouble', 'float32', 'float64', 'int8', 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'uint64', 'complex64', 'complex128', 'float', 'double', 'int', 'uint']: for dtype in ['int8', 'uint8', 'short', 'ushort', 'intc', 'uintc',
'longlong', 'ulonglong', 'single', 'double',
'longdouble', 'csingle', 'cdouble', 'clongdouble',
'float32', 'float64', 'int8', 'int16', 'int32',
'int64', 'uint8', 'uint16', 'uint32', 'uint64',
'complex64', 'complex128', 'float', 'double',
'int', 'uint']:
print dtype, np.zeros(1, dtype=dtype).dtype.num print dtype, np.zeros(1, dtype=dtype).dtype.num
int8 1
uint8 2
short 3
ushort 4
intc 5
uintc 6
longlong 9
ulonglong 10
single 11
double 12
longdouble 13
csingle 14
cdouble 15
clongdouble 16
float32 11
float64 12
int8 1
int16 3
int32 5
int64 7
uint8 2
uint16 4
uint32 6
uint64 8
complex64 14
complex128 15
float 12
double 12
int 7
uint 8
""" """
return { # dtype: (py_type, c_type, cls_name) return { # dtype: (py_type, c_type, cls_name)
'float32': (numpy.float32, 'npy_float32', 'Float32'), 'float32': (numpy.float32, 'npy_float32', 'Float32'),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论