So, if you want a 1:1 translation you’d probably end up with
model = torch.nn.Sequential(
    torch.nn.Linear(
        784, # number inputs
        10 # number outputs
    ),
    torch.nn.Softmax(dim=-1)
 )

And then call a function, initializing the weights with model.apply(init_func), where init_func is a function which will be called on every submodule of model.