How to do torch::nn::Linear = torch::nn::Sequential like python

I want to use the pretrained resnet50 for transfer-learning and fine-tuning at C++.

at python>>
resnet50 = models.resnet50(pretrained=True)

fc_inputs = resnet50.fc.in_features  #fc_inputs: 2048
resnet50->fc = nn.Sequential(
    nn.Linear(fc_inputs, 256),
    nn.Linear(256, 2))
at C++ >>
resnet50.fc = torch::nn::Sequential()  <- ERROR

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

Hope it helps