I'm trying to concatenate two tensors along their 3rd dimension.

param = T.concatenate(
    [img_param[:, :, :, :3], cost.repeat(2, axis=3)],
    axis=3
)


img_param has the shape (1, 128, 128, 5), cost is of shape (1, 128, 128, 1).

If I take cost directly from the input, this works perfectly fine.
Yet, if I first run T.nnet.conv2d with a constant filter (1, 1, 1, 1) I get:

ValueError: all the input array dimensions except for the concatenation 
axis must match exactly
Apply node that caused the error: Join(TensorConstant{3}, Subtensor{::, ::, 
::, :int64:}.0, Reshape{4}.0)
Toposort index: 12
Inputs types: [TensorType(int8, scalar), TensorType(float32, 4D), 
TensorType(float32, 4D)]
Inputs shapes: [(), (1, 128, 128, 3), (1, 128, 1, 2)]

The conv2d call:

cost = T.nnet.conv2d(
    input=input,
    filters=self.unary_w,
    input_shape=self.input_shp,
    filter_shape=self.unary_filter_shp,
    border_mode='valid'
). dimshuffle(0,2,3,1)


(I also made sure all dimensions are shuffled to the correct shape)

I tried returning both tensors to validate their shape and both return just 
fine.
I've looked a bit into this and it seems to have something to do with a 
sort of sparse-matrix conversion. Meaning Theano just automatically drops 
dimensions which are close to 0.

Any ideas?

Thanks,

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to