It seems that you are trying to stack the layers in convs on top of each other.
Since the in_channels and out_channels are fixed to x and y for each layer, this won’t work. if x!=y.
Could you explain a bit, what you mean by # [batch_size, num_layers, y, signal_length]?
Should your output have this shape? If so, what is the difference between num_layers and y?
In your code you define the number of out_channels as y. So num_layers should be y.