提交 74641bb9 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

fixed up some error messages

上级 d9023715
...@@ -864,7 +864,7 @@ nd_collapse_[i]=0; ...@@ -864,7 +864,7 @@ nd_collapse_[i]=0;
if ((!(broadcasts_%(iname)s[i] && CudaNdarray_HOST_DIMS(%(iname)s)[i] == 1))&& (dims[i] != CudaNdarray_HOST_DIMS(%(iname)s)[i])) if ((!(broadcasts_%(iname)s[i] && CudaNdarray_HOST_DIMS(%(iname)s)[i] == 1))&& (dims[i] != CudaNdarray_HOST_DIMS(%(iname)s)[i]))
{ {
//std::cerr << "C_CODE %(opname)s checking input %(iname)s failed\\n"; //std::cerr << "C_CODE %(opname)s checking input %(iname)s failed\\n";
PyErr_Format(PyExc_ValueError, "GpuElemwise. Input dimension mis-match.[%%i] == %%i, where output has size %%i", PyErr_Format(PyExc_ValueError, "GpuElemwise. Input dimension mis-match. One of your inputs has shape[%%i] == %%i, but the output's size on that axis is %%i.",
i, i,
CudaNdarray_HOST_DIMS(%(iname)s)[i], CudaNdarray_HOST_DIMS(%(iname)s)[i],
dims[i] dims[i]
......
...@@ -846,10 +846,10 @@ def local_gpu_join(node): ...@@ -846,10 +846,10 @@ def local_gpu_join(node):
# Try to make gpu gemm inplace # Try to make gpu gemm inplace
# Also, need to make the gemm optimisation(step 70) happen before the fusion of # Also, need to make the gemm optimisation(step 70) happen before the fusion of
# elemwise(step 71) # elemwise(step 71)
optdb.register('InplaceGpuBlasOpt', #optdb.register('InplaceGpuBlasOpt',
EquilibriumOptimizer([local_inplace_gemm], failure_callback=EquilibriumOptimizer.warn_inplace, # EquilibriumOptimizer([local_inplace_gemm], failure_callback=EquilibriumOptimizer.warn_inplace,
max_use_ratio=5), # max_use_ratio=5),
70.0, 'fast_run', 'inplace') # 70.0, 'fast_run', 'inplace')
def get_device_type_sizes(): def get_device_type_sizes():
if hasattr(get_device_type_sizes, 'rval'): if hasattr(get_device_type_sizes, 'rval'):
......
...@@ -4450,6 +4450,9 @@ class Dot(Op): ...@@ -4450,6 +4450,9 @@ class Dot(Op):
else: #y is a scalar else: #y is a scalar
bz = bx bz = bx
else: else:
if len(inputs) != 2:
raise TypeError('theanor.tensor.Dot: 2 arguments required, %d given ' % len(inputs))
x, y = inputs x, y = inputs
nx = x.type.ndim nx = x.type.ndim
ny = y.type.ndim ny = y.type.ndim
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论