Partially connected layer

I am planning to embed a graph data in a form of partially connected layer.

I think that I can construct a partially connected layer by setting specific element in weight matrix of fully connected layer as 0 and not learnable.

How can I do this job? Or do you have any other solution?