提交 02c959a7 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Rewrite of test_downsample to test the different settings of max_pool2D.

上级 834e31d0
...@@ -147,7 +147,7 @@ class DownsampleFactorMaxGrad(Op): ...@@ -147,7 +147,7 @@ class DownsampleFactorMaxGrad(Op):
def c_code_cache_version(self): def c_code_cache_version(self):
return () return ()
def max_pool2D(input, ds, ignore_border=False): def max_pool2D(input, ds, ignore_border=False):
""" """
Takes as input a N-D tensor, where N >= 2. It downscales the input image by Takes as input a N-D tensor, where N >= 2. It downscales the input image by
...@@ -166,7 +166,7 @@ def max_pool2D(input, ds, ignore_border=False): ...@@ -166,7 +166,7 @@ def max_pool2D(input, ds, ignore_border=False):
# extract image dimensions # extract image dimensions
img_shape = input.shape[-2:] img_shape = input.shape[-2:]
# count the number of "leading" dimensions, store as dmatrix # count the number of "leading" dimensions, store as dmatrix
batch_size = tensor.prod(input.shape[:-2]) batch_size = tensor.prod(input.shape[:-2])
batch_size = tensor.shape_padright(batch_size,1) batch_size = tensor.shape_padright(batch_size,1)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论