in libtorch,  you can do the following,
torch::nn::Sequential resnet50;
resnet50.push_back(nn::Conv2d(nn::Conv2dOptions(64, 256, 3)).stride(1).padding(1));

to run the forward
resnet50->forward(input);
Hope it helps