提交 85ca50fa authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Give more informative warning messages

上级 c482805d
...@@ -105,12 +105,14 @@ def conv2d(input, filters, input_shape=None, filter_shape=None, ...@@ -105,12 +105,14 @@ def conv2d(input, filters, input_shape=None, filter_shape=None,
warnings.warn(str(kwargs.keys()) + warnings.warn(str(kwargs.keys()) +
" are now deprecated in " " are now deprecated in "
"`tensor.nnet.abstract_conv.conv2d` interface" "`tensor.nnet.abstract_conv.conv2d` interface"
" and will be ignored.") " and will be ignored.",
stacklevel=2)
if image_shape is not None: if image_shape is not None:
warnings.warn("The `image_shape` keyword argument to " warnings.warn("The `image_shape` keyword argument to "
"`tensor.nnet.conv2d` is deprecated, it has been " "`tensor.nnet.conv2d` is deprecated, it has been "
"renamed to `input_shape`.") "renamed to `input_shape`.",
stacklevel=2)
if input_shape is None: if input_shape is None:
input_shape = image_shape input_shape = image_shape
else: else:
......
...@@ -367,7 +367,7 @@ class ConvOp(OpenMPOp): ...@@ -367,7 +367,7 @@ class ConvOp(OpenMPOp):
# with s=1 for mode=='full' and s=-1 for mode=='valid'. # with s=1 for mode=='full' and s=-1 for mode=='valid'.
# To support symbolic shapes, we express this with integer arithmetics. # To support symbolic shapes, we express this with integer arithmetics.
warnings.warn("The method `getOutputShape` is deprecated use" warnings.warn("The method `getOutputShape` is deprecated use"
"`get_conv_output_shape` instead.") "`get_conv_output_shape` instead.", stacklevel=2)
return tuple(get_conv_shape_1axis(i, k, mode, d) return tuple(get_conv_shape_1axis(i, k, mode, d)
for i, k, d in zip(inshp, kshp, stride)) for i, k, d in zip(inshp, kshp, stride))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论