Incorporate general NN into CNN

I would like to use a rather general neural network in a convolutional form. That is if my NN takes in three scalar values a,b,c and returns a scalar NN(a,b,c) I would like to have an efficient implementation of CNN=CNN(A,B,C) that takes in tensors A,B,C of the same size and the result is also of the same size, where the operations are component-wise.
What would be the most efficient way to implement this?