提交 369c9249 authored 作者: Frederic's avatar Frederic

Better error message when random don't have good shape. fix gh-3649

上级 f02bb033
......@@ -379,10 +379,14 @@ def _infer_ndim_bcast(ndim, shape, *args):
ndim = template.ndim
else:
v_shape = tensor.as_tensor_variable(shape)
if ndim is None:
ndim = tensor.get_vector_length(v_shape)
bcast = [False] * ndim
if v_shape.ndim != 1:
raise TypeError("shape must be a vector or list of scalar, got '%s'" %
v_shape)
if ndim is None:
ndim = tensor.get_vector_length(v_shape)
bcast = [False] * ndim
if (not (v_shape.dtype.startswith('int') or
v_shape.dtype.startswith('uint'))):
raise TypeError('shape must be an integer vector or list',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论