提交 39c92e49 authored 作者: f0k's avatar f0k

GpuCorrMM: more elaborate error message in case of shape inconsistency

上级 42463fc1
...@@ -208,11 +208,15 @@ CudaNdarray* corrMM(CudaNdarray *const bottom, ...@@ -208,11 +208,15 @@ CudaNdarray* corrMM(CudaNdarray *const bottom,
topHeight != CudaNdarray_HOST_DIMS(top)[2] || topHeight != CudaNdarray_HOST_DIMS(top)[2] ||
topWidth != CudaNdarray_HOST_DIMS(top)[3]) { topWidth != CudaNdarray_HOST_DIMS(top)[3]) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"GpuCorrMM shape inconsistency: From bottom and weights, " "GpuCorrMM shape inconsistency:\n"
"top shape should be %d %d %d %d, but is %d %d %d %d.\n", " bottom shape: %d %d %d %d\n"
batchSize, nFilters, topHeight, topWidth, " weight shape: %d %d %d %d\n"
" top shape: %d %d %d %d (expected %d %d %d %d)\n",
batchSize, nChannels, bottomHeight, bottomWidth,
nFilters, nChannels, kH, kW,
CudaNdarray_HOST_DIMS(top)[0], CudaNdarray_HOST_DIMS(top)[1], CudaNdarray_HOST_DIMS(top)[0], CudaNdarray_HOST_DIMS(top)[1],
CudaNdarray_HOST_DIMS(top)[2], CudaNdarray_HOST_DIMS(top)[3]); CudaNdarray_HOST_DIMS(top)[2], CudaNdarray_HOST_DIMS(top)[3],
batchSize, nFilters, topHeight, topWidth);
return NULL; return NULL;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论