You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
When using MKLDNN, concatenating sometimes fails and results in error. Please see the code.
Error Message
MXNetError: The size of NDArray doesn't match the requested MKLDNN memory desc. MKLDNN memory requests for 41943040 bytes, but got 34603008 bytes from NDArray
To Reproduce
x = mx.sym.Variable('x')
w = mx.sym.Variable('w')
c = mx.sym.Convolution(data=x, weight=w, num_filter=32, kernel=(3, 3), pad=(1, 1), no_bias=True)
n = mx.sym.concat(c, x, dim=1)
context = mx.cpu()
ex = n.simple_bind(context, x=(1, 1, 512, 512))
data = mx.nd.ones(ex.arg_arrays[0].shape, ctx=context)
weight = mx.nd.ones(ex.arg_arrays[1].shape, ctx=context)
If variable x is first tiled to have at least 8 channels (dimension 1), then it works:
c = mx.sym.Convolution(data=x, weight=w, num_filter=32, kernel=(3, 3), pad=(1, 1), no_bias=True)
x = mx.sym.tile(x, (1, 8, 1, 1))
n = mx.sym.concat(c, x, dim=1)
Another way is to reverse the order of concatenation:
n = mx.sym.concat(x, c, dim=1)