Apply Model Elementwise

Hi All,

I’ve spent some time reading approaches to this, but am curious for your advice.

I have a model phi(x) that takes inputs of dimension 1, and returns row vectors of dimension L. I’d like to apply it elementwise to a 2D matrix of data, giving me some 3D object.

Essentially, to write new_tensor = map(phi, old_tensor) in a differentiable way.

It looks like the way to do this is with a conv1d layer of some kind, but I can’t get it to work.

Any suggestions would be appreciated.