How to build an artificial layer of neural network?

Hi, I’ve read the codes of PyTorch, the layers are mainly about “nn.linear()”, “nn.sequential()” and so on, but I want to build a layer that is completely artiifcial by myself, I’ve read the documents of PyTorch, but I havn’t an idea, how could it be solved?
Please give an idea, thanks.

Could you explain a bit, what you mean by “artificial”?

Hi, the “artificial” means that can edit the layers optionally, for example, can consuct a kind of novel neural network just like ResNet before, that is, could PyTorch construct a network optionally? And could PyTorch edit the neurons of the network? Thanks.

If I understand your question correctly, you would like to use something like a neural architecture search?
If so, have a look at e.g. this DARTS implementation.

Thanks very much, I’ll have a study on the codes you present.