microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.49k stars 4.3k forks source link

MAX_POOLING crash, when pooling_window_shape contains 0 #3886

Open cheyennee opened 6 months ago

cheyennee commented 6 months ago

In following code, pooling_window_shape is a tuple with 0, C.pooling crash.

repo code:

img = np.reshape(np.arange(16, dtype=np.float32), [1, 4, 4])
x = C.input_variable(img.shape)
layer = C.pooling(operand=x, pooling_type=C.MAX_POOLING, pooling_window_shape=(2,0), strides=(1), ceil_out_dim=True, include_pad=True,
                  auto_padding=[True]).eval({x : [img]})
print(layer)
cheyennee commented 6 months ago

Same problem can be found in C.AVG_POOLING